Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

akkomar
Copy link
Contributor

@akkomar akkomar commented Jul 15, 2024

and dimension["type"] == "string"
):
# `event` field contains concatenated event category and name
dimension["name"] = "full_event_name"
Copy link
Contributor

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.
Copy link
Contributor

@sean-rose sean-rose Jul 15, 2024

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

event column from events_stream inaccessible in Looker
3 participants