Skip to content

Conversation

@Jayyadav1903
Copy link

This PR removes redundant try/except blocks in BigtableDeleteInstanceOperator in airflow/providers/google/cloud/operators/bigtable.py.

The underlying BigtableHook.delete_instance method already handles the case where the instance does not exist by logging a warning. Therefore, catching NotFound in the operator was unnecessary and duplicated logic.

I have also:

  • Updated the unit tests in providers/google/tests/unit/google/cloud/operators/test_bigtable.py to remove tests that specifically enforced this redundant exception handling.
  • Corrected the docstring in airflow/providers/google/cloud/hooks/bigtable.py which incorrectly stated that delete_instance raises NotFound.

Generated-by: Antigravity (Google DeepMind)

@Jayyadav1903 Jayyadav1903 requested a review from shahar1 as a code owner January 17, 2026 19:08
@boring-cyborg
Copy link

boring-cyborg bot commented Jan 17, 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 (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-cyborg boring-cyborg bot added area:providers provider:google Google (including GCP) related issues labels Jan 17, 2026
@SameerMesiah97
Copy link
Contributor

Doesn’t PR #60712 already address this?

Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like a file generated by the AI tool, we may not need this file here as it is the description for the PR.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This file is not needed and should be removed.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 to the above

except google.api_core.exceptions.GoogleAPICallError as e:
self.log.error("An error occurred. Exiting.")
raise e
hook.delete_instance(project_id=self.project_id, instance_id=self.instance_id)
Copy link
Contributor

Choose a reason for hiding this comment

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

another case in the error handling except google.api_core.exceptions.GoogleAPICallError as e is also removed. In this case, an error need to be raised instead of showing a logging. It looks different from the PR description that only NotFound looks redundant.

Copy link
Contributor

Choose a reason for hiding this comment

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

If such exception occurs, it will occur even without exception case, but without showing the error log "An error occured. Exiting.".
Whether the latter log error is really necessary - I doubt, but I think that it should be clarified within the PR description and title.

Copy link
Contributor

@shahar1 shahar1 left a comment

Choose a reason for hiding this comment

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

Hello and welcome to Apache Airflow:
While I do appreciate the effort your put into creating this PR, I would like to draw your attention to two general notes:

  1. The issue that this PR resolves has been assigned to another contributor yesterday. As a general rule of thumb, it's best to wait a while (at least a week) before creating a PR for issue that has been assigned to someone else, as it’s not considered polite (and even a bit rude) to get in someone else’s way. You should ask in the GitHub issue if it's still in progress, and if the assignee responds that "no" or doesn't respond for a too long - then you may ask to be assigned instead.
  2. While use of AI is allowed, and you've even mentioned that you used it for this PR - it should not be trusted blindly and you also need to adhere to the project's standards. Adding the PR_DESCRIPTION.md to the root can signals to maintainers that something might be off.

I hope that you'll consider the above for your future contributions.
Please address the issues mentioned in this PR, including updating title and the description - I'll appreciate if you could try finalizing it without using AI (it's possible).

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 to the above

except google.api_core.exceptions.GoogleAPICallError as e:
self.log.error("An error occurred. Exiting.")
raise e
hook.delete_instance(project_id=self.project_id, instance_id=self.instance_id)
Copy link
Contributor

Choose a reason for hiding this comment

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

If such exception occurs, it will occur even without exception case, but without showing the error log "An error occured. Exiting.".
Whether the latter log error is really necessary - I doubt, but I think that it should be clarified within the PR description and title.

@Jayyadav1903
Copy link
Author

This was my very first PR as I am a rookie in open source and would try to resolve all the issues at the earliest.
And I would also like to apologize for my impolite actions and would keep in mind not to repeat them again.

@shahar1
Copy link
Contributor

shahar1 commented Jan 20, 2026

This was my very first PR as I am a rookie in open source and would try to resolve all the issues at the earliest. And I would also like to apologize for my impolite actions and would keep in mind not to repeat them again.

It's alright, apologize accepted!
I'd like to give the original assignee an opportunity to finish working on this file.
Please go over unassigned issues labeled as good first issue and give them a try - I'll be happy to review.

@Jayyadav1903
Copy link
Author

I'll surely do that.

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.

5 participants