Skip to content

Fix BigQueryStreamingBufferEmptySensor false negative metadata lag#67401

Open
arsenelupin14 wants to merge 4 commits into
apache:mainfrom
arsenelupin14:fix-bigquery-sensor-lag
Open

Fix BigQueryStreamingBufferEmptySensor false negative metadata lag#67401
arsenelupin14 wants to merge 4 commits into
apache:mainfrom
arsenelupin14:fix-bigquery-sensor-lag

Conversation

@arsenelupin14
Copy link
Copy Markdown

Closes #66963

BigQuery's streamingBuffer metadata is eventually consistent, causing false negatives in BigQueryStreamingBufferEmptySensor immediately after a streaming insert.

This PR introduces a consecutive_empty_checks parameter (by default: 1) to the sensor and its deferrable trigger. By setting this to >1, the sensor will require multiple consecutive empty observations before passing, safely bypassing the lag window. Also removes the manual time.sleep workaround from example_bigquery_streaming_buffer_sensor.py .

@arsenelupin14 arsenelupin14 requested a review from shahar1 as a code owner May 24, 2026 13:34
@boring-cyborg boring-cyborg Bot added area:providers provider:google Google (including GCP) related issues labels May 24, 2026
@boring-cyborg
Copy link
Copy Markdown

boring-cyborg Bot commented May 24, 2026

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example Dag that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@potiuk
Copy link
Copy Markdown
Member

potiuk commented May 24, 2026

@arsenelupin14 A few things need addressing before review — see our Pull Request quality criteria.

  • CI fails: CI image checks / Static checks (and possibly other checks — see the Checks tab for the full list).

No rush.


Note: This comment was drafted by an AI-assisted triage tool and may contain mistakes. Once you have addressed the points above, an Apache Airflow maintainer — a real person — will take the next look at your PR. We use this two-stage triage process so that our maintainers' limited time is spent where it matters most: the conversation with you.


Drafted-by: Claude Code (Opus 4.7); reviewed by @potiuk before posting

@arsenelupin14 arsenelupin14 force-pushed the fix-bigquery-sensor-lag branch from 40c800a to 17c9bea Compare May 25, 2026 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:google Google (including GCP) related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BigQueryStreamingBufferEmptySensor can falsely report an empty streaming buffer (metadata lag)

2 participants