Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce operation helper class and refactor #147

Closed
wants to merge 1 commit into from

Conversation

olegkachur-e
Copy link
Collaborator

  • Refactor google cloud hooks, that used generic 'wait_for_operation' methods.

^ 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.

- Refactor google cloud hooks, that used generic 'wait_for_operation'
  methods.
Copy link
Collaborator

@MaksYermak MaksYermak left a comment

Choose a reason for hiding this comment

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

LGTM
One question from my side. What do you think about removing this method from this class either: https://github.com/apache/airflow/blob/main/providers/src/airflow/providers/google/cloud/hooks/dataproc_metastore.py#L61 ? I see that this method has logs, but in general it the same method and for me it looks like we can remove it either. @olegkachur-e WDYT?

@olegkachur-e
Copy link
Collaborator Author

LGTM One question from my side. What do you think about removing this method from this class either: https://github.com/apache/airflow/blob/main/providers/src/airflow/providers/google/cloud/hooks/dataproc_metastore.py#L61 ? I see that this method has logs, but in general it the same method and for me it looks like we can remove it either. @olegkachur-e WDYT?

Agreed, but looks like logs were added recently, so I assume they are needed at some point.
It's not obvious from the PR itself, but we had an idea to

  1. introduce the generic class for Operation, but do not break existing naming
  2. Deprecate wait_for_operation -s and suggest replacement with our implementation of wait_of_operation_result
  3. Eventually delete deprecated code and try to use OperationHelper class whenever it's possible.

For that being said, we can address log-s issue during further refactoring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants