Skip to content

Add new experiments_column_type to support events_stream tables#507

Merged
relud merged 1 commit into
mainfrom
relud-patch-1
May 28, 2025
Merged

Add new experiments_column_type to support events_stream tables#507
relud merged 1 commit into
mainfrom
relud-patch-1

Conversation

@relud
Copy link
Copy Markdown
Contributor

@relud relud commented May 5, 2025

fixes mozilla/jetstream#2174

I'm unclear if there's more plumbing this needs.

I went for a condition that's going to match the other type's semantics of checking both experiment and branch, but I don't understand enough to tell if that's actually necessary or preferrable.

@relud relud requested a review from mikewilli May 5, 2025 19:03
Copy link
Copy Markdown
Contributor

@mikewilli mikewilli left a comment

Choose a reason for hiding this comment

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

Awesome thanks!

Comment on lines +432 to +436
"""IF(
JSON_VALUE(ds.event_extra, '$.experiment') = '{experiment_slug}',
JSON_VALUE(ds.event_extra, '$.branch'),
NULL
) != e.branch """
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yea I think you're right that this matches the other checks a little more closely than just checking the branch alone, and either way it's no harm to check the experiment + branch.

Comment thread tests/test_metrics.py
Comment on lines 10 to 15

@pytest.mark.parametrize("experiments_column_type", [None, "simple", "native", "glean"])
@pytest.mark.parametrize(
"experiments_column_type", [None, "simple", "native", "glean", "events_stream"]
)
def test_datasource_constructor_succeeds(experiments_column_type):
DataSource(
name="foo",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It seems like there should be more tests than this (e.g., for the two functions you modified here). I know we have more comprehensive testing in jetstream so maybe not a big deal, but if you've got some time and inclination now want to tackle that here? Otherwise can you just file a ticket (in mozanalysis issues is good) to add unit tests for those two functions?

@mikewilli
Copy link
Copy Markdown
Contributor

@relud Want to land this? Or are you working on the tests?

@relud relud merged commit 71c23f0 into main May 28, 2025
3 checks passed
@relud relud deleted the relud-patch-1 branch May 28, 2025 16:16
@relud
Copy link
Copy Markdown
Contributor Author

relud commented May 28, 2025

@relud Want to land this? Or are you working on the tests?

i'll merge now and file a follow up pr for tests when i catch a break between other tasks

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.

Add new experiments_column_type to support events_stream tables

2 participants