Skip to content

Add network tags to google cloud operator - #40630

Closed
kunaljubce wants to merge 9 commits into
apache:mainfrom
kunaljubce:add-network-tags-to-google-cloud-operator
Closed

kunaljubce wants to merge 9 commits into
apache:mainfrom
kunaljubce:add-network-tags-to-google-cloud-operator

Conversation

@kunaljubce

@kunaljubce kunaljubce commented Jul 6, 2024 •

Copy link
Copy Markdown
Contributor

closes: #40232


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@boring-cyborg boring-cyborg Bot added area:providers provider:google Google (including GCP) related issues labels Jul 6, 2024
@boring-cyborg

boring-cyborg Bot commented Jul 6, 2024

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 pre-commits 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

@kunaljubce kunaljubce changed the title Add network tags to google cloud operator 🚧 WIP 🚧 Add network tags to google cloud operator Jul 6, 2024
@kunaljubce kunaljubce changed the title 🚧 WIP 🚧 Add network tags to google cloud operator Add network tags to google cloud operator Jul 6, 2024
@potiuk

potiuk commented Jul 7, 2024

Copy link
Copy Markdown
Member

Static checks failing (I recommend installing pre-commit https://github.com/apache/airflow/blob/main/contributing-docs/08_static_code_checks.rst to fix it automatically).

@kunaljubce

Copy link
Copy Markdown
Contributor Author

Static checks failing (I recommend installing pre-commit https://github.com/apache/airflow/blob/main/contributing-docs/08_static_code_checks.rst to fix it automatically).

I am looking into these @potiuk, thanks for your review! I will confirm here once this PR is ready for review again.

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

Thank you for the contribution!
Could you please update the PR description and the title so it would be clear that changes affect only the DataprocCreateBatchOperator (not every google operator).

project_id=self.project_id,
region=self.region,
gcp_conn_id=self.gcp_conn_id,
tags=self.tags,

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.

In my opinion we shouldn't pass tags to the trigger because the only thing it is responsible for - is polling the batch by batch_id. Because the batch_id is unique and sufficient for the batch identification, we probably shouldn't use tags here. Moreover, this PR doesn't contain any changes for the DataprocBatchTrigger, so it doesn't even accept this parameter.

batch_id=self.batch_id,
region=self.region,
project_id=self.project_id,
tags=self.tags,

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.

The same here. If we are waiting for the batch, batch_id is enough to identify it, so we don't have to use rags here.

context,
key=DataprocBatchLink.key,
value={"batch_id": batch_id, "region": region, "project_id": project_id},
value={"batch_id": batch_id, "region": region, "project_id": project_id, "tags": tags},

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.

Does the batch URL contain network tags?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@moiseenkov I am verifying this, will confirm in a couple of days.

@kunaljubce

Copy link
Copy Markdown
Contributor Author

Closing this as Not Needed since the related issue #40232 is closed now.

@kunaljubce kunaljubce closed this Jul 26, 2024
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.

Support network tags in airflow.providers.google.cloud.operators.dataproc.DataprocCreateBatchOperator()

3 participants