-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename event
to full_event_name
in events_stream
views
#1007
base: main
Are you sure you want to change the base?
Conversation
and dimension["type"] == "string" | ||
): | ||
# `event` field contains concatenated event category and name | ||
dimension["name"] = "full_event_name" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the and not (name == "event" and dimension["type"] == "time")
line below be removed since this is being renamed? Looks like that's just for events stream #854 and might be useful to catch other similar issues. Not critical though and maybe it's better to leave it as-is
@@ -117,6 +117,16 @@ def _generate_dimensions(client: bigquery.Client, table: str) -> List[Dict[str, | |||
""" | |||
dimensions = {} | |||
for dimension in _generate_dimensions_helper(client.get_table(table).schema): | |||
# Rename `event` field in `events_stream` to `full_event_name` to expose it in Looker views. | |||
# This is required since `event_timestamp` is renamed to `event` in `_get_dimension` and takes precedence below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it would be better to change the other logic to not have dimension groups conflict in this way, since they wouldn't actually conflict in the generated LookML, as dimension groups generate dimensions with timeframe suffixes. For example, in this particular instance having both a dimension: event
and dimension_group: event
would be totally fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for mentioning this, I didn't know Looker allows dimensions and dimension groups with the same name. I'll see if I can change this logic to allow both fields without this rename.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes mozilla/bigquery-etl#5903