-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Allow passing empty labels in the spark kubernetes driver config #45864
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
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 Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
bbdcb82 to
b25bf78
Compare
|
Can you please add a unit test showing the issue and preventing regression in the future? Thanks in advance! |
|
@potiuk - sure, I'll work on it in the next few days and update the PR. Thank you for taking a look! |
b25bf78 to
e22539b
Compare
|
@potiuk - I looked at the code and how it can be unit-tested, and this is more challenging than I thought at first. Inside the The best option to implement the unit test was to mock the response of the @potiuk - please let me know if this is what would be a good enough test or if you have any other options in mind. Thank you for your review in advance! |
069d865 to
a78c183
Compare
a78c183 to
f068a09
Compare
|
@potiuk @hussein-awala @jedcunningham - hey everyone, Appreciate you taking time to review this MR. Could you please take a look whenever you have time so that we can merge this simple change and include it into the next version of airflow release if possible. Thank you in advance! |
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
…che#45864) * Allow passing empty labels in the driver config * Fix formatting * Fix formatting --------- Co-authored-by: Maxim Logvinenko <maxim.logvinenko@coinmetrics.io>
…che#45864) * Allow passing empty labels in the driver config * Fix formatting * Fix formatting --------- Co-authored-by: Maxim Logvinenko <maxim.logvinenko@coinmetrics.io>
…che#45864) * Allow passing empty labels in the driver config * Fix formatting * Fix formatting --------- Co-authored-by: Maxim Logvinenko <maxim.logvinenko@coinmetrics.io>
…che#45864) * Allow passing empty labels in the driver config * Fix formatting * Fix formatting --------- Co-authored-by: Maxim Logvinenko <maxim.logvinenko@coinmetrics.io>
"labels" section of the k8s yaml configuration is optional for both kubernetes client and spark-operator. However, if labels are not passed as part of the configuration then the job fails with the following exception:
Proposed fix is just to use
getmethod, which instead of KeyError would returnNone, which should be perfectly fine for theV1ObjectMetaobject.^ 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.rstor{issue_number}.significant.rst, in newsfragments.