-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Added overrides parameter to CloudRunExecuteJobOperator
#34874
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
Added overrides parameter to CloudRunExecuteJobOperator
#34874
Conversation
|
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 Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
|
|
Looks like google-cloud-run pypi (repo is called googleapis/python-run) doesn't even have the overrides variable available in their API yet. I made an issue for adding this functionality on the googleapis/python-run repo. |
|
Functionality is there and will be released in v0.10.0: googleapis/python-run#127 |
e56daad to
6e8f42a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type for overrides should indicate the type for the key and the values, though most often it is dict[str, Any] a dictionary allows other types for the key such as integers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you saying I need to make sure that the type of the dictionary is more specific?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
Something like
overrides: dict[str, Any] | None = NoneIf that is the expect key type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What kind of dict are we expecting here? If it is defined well, I prefer adding typing to it. If not, do dict[str, Any]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cjames23 @amoghrajesh I modified the dictionary type based on what is expected here: https://github.com/googleapis/python-run/blob/main/google/cloud/run_v2/types/job.py#L258
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I could see some of the values in this dictionary could be integers, so better use dict[str, Any] | None
|
Need to fix remaining Static Checks For quick fix would be enough to install pre-commit and run pip install pre-commit
pre-commit install # should be run in the cloned airflow repo directory
pre-commit run black --all-files
pre-commit run ruff --all-filesAfter that add files and push into repo |
7021f48 to
85aca2f
Compare
Taragolis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
85aca2f to
11b4237
Compare
cjames23
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
overrides parameter for CloudRunExecuteJobOperator
overrides parameter for CloudRunExecuteJobOperatoroverrides parameter to CloudRunExecuteJobOperator
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
This PR aims to add the functionality of the "overrides" variable for the CloudRunExecuteJobOperator as provided by the google.cloud.run.v2 package.
Notes: