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

Feature/pass airflow confi as job param #39007

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

SubhamSinghal
Copy link
Contributor

@SubhamSinghal SubhamSinghal commented Apr 14, 2024

Fixes: #39002

Tests:

  1. empty airflow config and empty job parameter -- empty job parameter
  2. empty airflow config and some job parameter in databricks operator -- job params from operator get applied
  3. non empty airflow config with empty job parameter -- airflow config gets passed as job param
  4. non empty airflow config with non empty job parameter -- job params from operator get applied

@SubhamSinghal
Copy link
Contributor Author

@dirrao Let me know if it makes more sense to add a flag "import_airflow_config" and when it is True then set airflow config as job_params in databricks jobs.

Comment on lines +317 to +321
job_params = self.params.items() if self.params.items() else {}
param_list = []
for k, v in job_params:
param_list.append({"name": k, "default": v})
self.json["parameters"] = param_list
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
job_params = self.params.items() if self.params.items() else {}
param_list = []
for k, v in job_params:
param_list.append({"name": k, "default": v})
self.json["parameters"] = param_list
if self.params.items() is not None:
self.json["parameters"] = [{"name": k, "default": v} for for k, v in self.params.items()]
else:
self.json["parameters"] = {}

Copy link
Member

Choose a reason for hiding this comment

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

Where is this self.params from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are airflow configs

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

Successfully merging this pull request may close these issues.

Allow passing airflow params as job parameter in databricks job
4 participants