Skip to content

Add unit tests for Gen AI operator exception handling. - #61790

Merged
jscheffl merged 4 commits into
apache:mainfrom
ytoprakc:gen-ai-exceptions-unit-tests
Feb 21, 2026
Merged

Add unit tests for Gen AI operator exception handling.#61790
jscheffl merged 4 commits into
apache:mainfrom
ytoprakc:gen-ai-exceptions-unit-tests

Conversation

@ytoprakc

@ytoprakcytoprakc commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

This PR adds unit tests for exception handling for all relevant Gen AI operators as part of #61261.

@boring-cyborg

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 (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
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

@boring-cyborgboring-cyborgBot added area:providers provider:google Google (including GCP) related issues labels Feb 11, 2026
@ytoprakc
ytoprakcforce-pushed the gen-ai-exceptions-unit-tests branch 2 times, most recently from c194650 to b74a1baCompareFebruary 11, 2026 21:17

@SameerMesiah97SameerMesiah97 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.

Looks fine (conditional on CI passing). I have left a few comments to refine the PR.

There is one general point I wanted to raise. It seems like for each test, you are asserting a different exception type. For some it's ClientError, but for others it's AirflowException or RuntimeError. If this reflects variations in the underlying semantics of the different operators, then it is perfectly fine. But if this is accidental, I would try to address this as well.

Comment threadproviders/google/tests/unit/google/cloud/operators/test_gen_ai.py Outdated
Comment threadproviders/google/tests/unit/google/cloud/operators/test_gen_ai.py Outdated
Comment threadproviders/google/tests/unit/google/cloud/operators/test_gen_ai.py Outdated
Comment threadproviders/google/tests/unit/google/cloud/operators/test_gen_ai.py Outdated

@shahar1shahar1 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.

It seems that you accidentally added unrelated commits to this PR - please fix.

@ytoprakc
ytoprakc marked this pull request as draft February 12, 2026 19:17
@ytoprakc
ytoprakcforce-pushed the gen-ai-exceptions-unit-tests branch from 1d645ba to 2fdece7CompareFebruary 12, 2026 19:42
@ytoprakc
ytoprakc marked this pull request as ready for review February 12, 2026 19:52
@ytoprakc
ytoprakcforce-pushed the gen-ai-exceptions-unit-tests branch 4 times, most recently from 95f0be9 to 053b99dCompareFebruary 16, 2026 19:41

@pierrejeambrunpierrejeambrun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IT just needs a tiny bit adjustment to fix the CI if you don't mind.

@ytoprakc
ytoprakcforce-pushed the gen-ai-exceptions-unit-tests branch from 053b99d to ab4ab76CompareFebruary 20, 2026 14:16
@jscheffl
jscheffl merged commit 18fb705 into apache:mainFeb 21, 2026
89 checks passed
@boring-cyborg

Copy link
Copy Markdown

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

choo121600 pushed a commit to choo121600/airflow that referenced this pull request Feb 22, 2026
* Add unit tests for Gen AI operator exception handling.
* Remove strict match assertions from Gen AI operator unit tests.
* Fix ClientError instantiation.
* Fix ClientError exception for lowest-direct-dependencies test.
dominikhei pushed a commit to dominikhei/airflow that referenced this pull request Mar 11, 2026
* Add unit tests for Gen AI operator exception handling.
* Remove strict match assertions from Gen AI operator unit tests.
* Fix ClientError instantiation.
* Fix ClientError exception for lowest-direct-dependencies test.
Ankurdeewan pushed a commit to Ankurdeewan/airflow that referenced this pull request Mar 15, 2026
* Add unit tests for Gen AI operator exception handling.
* Remove strict match assertions from Gen AI operator unit tests.
* Fix ClientError instantiation.
* Fix ClientError exception for lowest-direct-dependencies test.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providersprovider:googleGoogle (including GCP) related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@ytoprakc@pierrejeambrun@shahar1@SameerMesiah97@jscheffl