Skip to content

Fix Cloud Monitoring list operators with explicit output formats - #73434

Merged
shahar1 merged 2 commits into
apache:mainfrom
ylv01:fix/stackdriver-list-format
Sep 22, 2026
Merged

shahar1 merged 2 commits into
apache:mainfrom
ylv01:fix/stackdriver-list-format

Conversation

@ylv01

@ylv01 ylv01 commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Explicit format_="dict" and format_="json" currently fail because both Cloud Monitoring list operators attempt to convert the hook's already-formatted output as protobuf objects. Preserve that output unchanged for "dict" and "json", and retain protobuf-to-dictionary conversion for None and unrecognized values for XCom serialization.

Update both operator docstrings and add parametrized regression tests for both explicit formats. The existing default-format tests remain unchanged. Six additional regression cases cover "Dict", "protobuf", and the empty string across both operators.

Closes #73431.

Rebased onto the merged rename in #73354. The fix and regression tests now target cloud_monitoring.py; the deprecated Stackdriver aliases remain unchanged.

After rebasing onto #73354, Linux Breeze verification passed all 54 tests across the Cloud Monitoring and deprecated Stackdriver operator/hook test files. Reverting the implementation makes all four explicit-format regression cases fail as expected. Ruff and git diff --check also passed. The refreshed upstream CI is running.

Initial implementation validation passed in Linux Breeze CI:

  • Regular and manual prek checks on both changed files, including provider type checks.
  • Complete Stackdriver operator and hook unit-test files.
  • Regression verification: reverting only the operator fix makes all four new cases fail.
  • Breeze selective checks.

The unit tests and regression verification also passed in an independent run. Local Ruff formatting/linting and git diff --check passed. Local Breeze testing was blocked by missing Docker on Windows, so the test and check suites ran on Linux. Verification workflows live only on separate fork branches and are not part of this PR.


Was generative AI tooling used to co-author this PR?
  • Yes — OpenAI Codex (GPT-6)

Generated-by: OpenAI Codex (GPT-6) following the guidelines

@ylv01
ylv01 requested a review from shahar1 as a code owner September 21, 2026 09:18
@boring-cyborg boring-cyborg Bot added area:providers provider:google Google (including GCP) related issues labels Sep 21, 2026
@boring-cyborg

boring-cyborg Bot commented Sep 21, 2026

Copy link
Copy Markdown

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

@shahar1 shahar1 left a comment

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.

Thanks for the fix — it maps one-for-one onto the issue's acceptance criteria, and the
regression tests are well scoped: they fail without the operator change, and the existing
default-format tests still assert the format_=None protobuf conversion.

One edge case worth tightening, left inline. Not blocking.

CI hasn't run on this PR yet (first PR to the repo — workflow runs need maintainer
approval), so I'm leaving this as a comment rather than an approval until the checks
are green.

As noted in #73431, I'll carry this over to the cloud_monitoring rename in #73354
before that one merges.


This review was drafted by an AI-assisted tool and
confirmed by an Apache Airflow maintainer. The findings
below are observations, not blockers; an Apache Airflow
maintainer — a real person — will take the next look at the
PR. If you think a finding is mis-applied, please reply on
the PR and a maintainer will weigh in.

More on how Apache Airflow handles maintainer review:
contributing-docs/05_pull_requests.rst.

Comment thread providers/google/src/airflow/providers/google/cloud/operators/stackdriver.py Outdated
Comment thread providers/google/src/airflow/providers/google/cloud/operators/stackdriver.py Outdated
@ylv01
ylv01 force-pushed the fix/stackdriver-list-format branch from 0f52c5f to aa4e3aa Compare September 21, 2026 10:06
@ylv01

ylv01 commented Sep 21, 2026

Copy link
Copy Markdown
Contributor Author

I also went through the updated diff manually and verified the new regression tests. Thanks again, @shahar1, for catching this compatibility edge case.

@shahar1

shahar1 commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

I also went through the updated diff manually and verified the new regression tests. Thanks again, @shahar1, for catching this compatibility edge case.

Please fix static checks

Avoid converting dictionaries and JSON strings as protobuf objects while retaining XCom-compatible default results.

Generated-by: OpenAI Codex (GPT-6)
Unrecognized formats still return protobuf objects from the hook and must remain XCom-serializable.

Generated-by: OpenAI Codex (GPT-6)
@ylv01
ylv01 force-pushed the fix/stackdriver-list-format branch from aa4e3aa to 0c99789 Compare September 22, 2026 01:05
@ylv01 ylv01 changed the title Fix Stackdriver list operators with explicit output formats Fix Cloud Monitoring list operators with explicit output formats Sep 22, 2026
@shahar1
shahar1 merged commit 890c20b into apache:main Sep 22, 2026
86 checks passed
@boring-cyborg

boring-cyborg Bot commented Sep 22, 2026

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

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.

Fix Cloud Monitoring list operators when format_ is set

2 participants