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

feat(dryrun): Pass all query parameters when dry-running queries #6835

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sean-rose
Copy link
Contributor

@sean-rose sean-rose commented Jan 17, 2025

Description

The bqetl dryrun command doesn't currently support queries which use any non-date query parameters. This PR adds support for such queries by passing all expected query parameters when dry-running queries.

This depends on mozilla-services/cloudops-infra#6189 to update the bigquery_etl_dryrun Google Cloud function to accept query parameters as an argument.

Related Tickets & Documents

Reviewer, please follow this checklist

┆Issue is synchronized with this Jira Task

bigquery_etl/dryrun.py Show resolved Hide resolved
query_parameters = []
scheduling_metadata = self.metadata.scheduling if self.metadata else {}
if date_partition_parameter := scheduling_metadata.get(
"date_partition_parameter", "submission_date"
Copy link
Contributor

Choose a reason for hiding this comment

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

Does submission_date need to be set if if there's no date_partition_parameter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If date_partition_parameter isn't specified at all in the scheduling metadata then it does default to passing a @submission_date parameter, so dryrun should too. However, if date_partition_parameter is set to null in the scheduling metadata then no @submission_date parameter is passed by default, so this does the same in that case (the "date_partition_parameter" key will exist in the scheduling dictionary, so the get() will return the null value as None which won't pass the if check).

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I see. I didn't know it did that

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.

2 participants