-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
Used cached property for hook in SparkKubernetesOperator #34130
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)
|
7e692e8
to
9fa313a
Compare
Updated existing test case, which expected kubernetesHook to be called once. As the call has been moved out of constructor, it will not be called when object is created. |
457c6d2
to
73791da
Compare
rebased with main and squashed commits. |
Airflow Best practice recommends no top-level code. Constructors should be as simple as possible. Currently, this operator directly builds a KubernetesHook object in its construction which has to make calls to db every time the dag is rendered:
This also doesn't allow for templating of kubernetes_conn_id as brought up in Airflow Slack
^ 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.