google cloud platform – How can I access the user_properties column?

Within BigQuery I have access to all the viewable columns and can query them freely, however, when using the google-cloud-bigquery library I get a google.api_core.exceptions.BadRequest: 400 Unrecognized name: user_properties error.

From what I can see, these are Unsupported field types. Is there no way to access these columns, or am I performing an incorrect query?

SQL:

SELECT user_id,
NULLIF(COUNT(CASE WHEN user_property.value.string_value="user_type_1" THEN 1 END), 0) as user_type_1_engagement, 
NULLIF(COUNT(CASE WHEN user_property.value.string_value="user_type_2" THEN 1 END), 0) as user_type_2_engagement, 
NULLIF(COUNT(CASE WHEN user_property.value.string_value="user_type_3" THEN 1 END), 0) as user_type_3_engagement 
FROM `.analytics_.events_`, 
UNNEST(user_properties) AS user_property 
WHERE user_id LIKE '%%' 
AND user_property.key = 'user_role' 
GROUP BY user_id

Within BQ: Query runs and returns expected values

Within the project: The query is unable to find the column called

user_properties

Read more here: Source link