Repository navigation
Cover long-running jobs in the deferrable BigQuery check system test - #74356
Merged
henry3260 merged 1 commit intoOct 16, 2026
Merged
Conversation
The deferrable value and interval checks in the async BigQuery system test only ran trivial COUNT(*) queries, so their jobs were DONE before the trigger's first poll. The regression fixed in apache#74305, where BigQueryValueCheckTrigger and BigQueryIntervalCheckTrigger failed with "Job running" while the job was still RUNNING (apache#73981), could therefore never show up in the system test. Add a view backed by a JavaScript UDF that keeps a query RUNNING for tens of seconds and run both deferrable checks against it. The view only reads the existing two-row table, so each check job is billed at BigQuery's 10 MB minimum.
Contributor
Author
molcay
approved these changes
Oct 7, 2026
molcay
left a comment
Contributor
There was a problem hiding this comment.
LGTM!
Again, thanks for handling this matter!
Very much appreciated 🙇🏼
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The deferrable
BigQueryValueCheckOperatorandBigQueryIntervalCheckOperatorin the async BigQuery system test only ever ran trivialCOUNT(*)queries, so their jobs wereDONEbefore the trigger's first poll and the regression fixed in #74305 (#73981: triggers failed withJob runningwhenever the job was stillRUNNING) could not be observed there.This extends
example_bigquery_queries_async.pywith a view that is slow on purpose and runs both deferrable checks against it:create_slow_viewcreates a JavaScript UDF with a fixed 5e8-iteration loop and a view over the existing two-row table that evaluates it per row, so a query over the view staysRUNNINGfor tens of seconds.CURRENT_TIMESTAMP()in the view keeps BigQuery from serving repeated checks from the query cache.check_value_long_running(BigQueryValueCheckOperator, deferrable) andcheck_interval_long_running(BigQueryIntervalCheckOperator, deferrable) run against the view. They are wired outside thehowto_operator_*doc snippets so the documentation examples stay unchanged.Cost: on-demand billing charges for bytes scanned, not for UDF CPU time, and the view only reads the two-row table, so every check job is billed at BigQuery's 10 MB minimum.
Testing against a real BigQuery project (on-demand, no reservations):
eda8563d98^),check_value_long_runningfailed all three attempts withAirflowException: Job running(the check jobs took 15–45 s), reproducing BigQueryValueCheckTrigger and BigQueryIntervalCheckTrigger fail while the BigQuery job is still running #73981. In an earlier run with a shorter loop,check_interval_long_runningalso failed with the misreportedJob completedmessage from the second bug in that issue.check_openlineage_eventsfails in my local pytest harness for both the modified Dag and the unmodified Dag (Couldn't find any OpenLineage transport configurationin task processes), so that task's result is unrelated to this change. The new tasks have no OpenLineage expectations.providers/google/tests/unit/google/cloud/triggers/test_bigquery.pystill cover the trigger logic; this PR only touches the system test.related: #73981
related: #74305
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Claude Fable 5.1) following the guidelines
🤖 Generated with Claude Code