Feature/pass airflow confi as job param#39007
Closed
SubhamSinghal wants to merge 4 commits intoapache:mainapache/airflow:mainfrom
SubhamSinghal:feature/pass-airflow-confi-as-job-paramSubhamSinghal/airflow:feature/pass-airflow-confi-as-job-paramCopy head branch name to clipboard
Closed
Feature/pass airflow confi as job param#39007SubhamSinghal wants to merge 4 commits intoapache:mainapache/airflow:mainfrom SubhamSinghal:feature/pass-airflow-confi-as-job-paramSubhamSinghal/airflow:feature/pass-airflow-confi-as-job-paramCopy head branch name to clipboard
SubhamSinghal wants to merge 4 commits intoapache:mainapache/airflow:mainfrom
SubhamSinghal:feature/pass-airflow-confi-as-job-paramSubhamSinghal/airflow:feature/pass-airflow-confi-as-job-paramCopy head branch name to clipboard
Conversation
dirrao
reviewed
Apr 15, 2024
dirrao
reviewed
Apr 15, 2024
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. |
Lee-W
reviewed
Apr 16, 2024
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 |
Member
There was a problem hiding this comment.
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"] = {} |
Contributor
Author
There was a problem hiding this comment.
These are airflow configs
Contributor
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions. |
2 tasks
1 task
moomindani
added a commit
to moomindani/airflow
that referenced
this pull request
May 9, 2026
Apply Lee-W's review suggestion from PR apache#39007: replace the manual loop with a list comprehension that uses ``params.dump()`` (the original ``params.items()`` iteration yielded ``Param`` objects rather than the resolved values, which would not serialise into the Databricks API). Extend the same pattern to: * DatabricksRunNowOperator -> populate top-level ``job_parameters`` (the dict-shaped slot already supported by the run-now endpoint). * DatabricksSubmitRunOperator -> populate dict-shaped per-task parameter fields (notebook_task.base_parameters, python_wheel_task.named_parameters, sql_task.parameters, run_job_task.job_parameters). Tasks whose only parameter field is ``List[str]`` (spark_jar_task, spark_python_task, spark_submit_task) are intentionally skipped because there is no canonical mapping from a key/value dict to positional CLI arguments. Drop the ``"parameters": []`` expectation that was added to the existing test_exec_create / test_exec_reset cases by PR apache#39007 — it never matched the source logic (``self.params`` is falsy when no params are set, so no ``parameters`` key is added). Add tests covering: auto-injection for each operator, no override when the field is already populated, and the per-task injection rules for SubmitRun.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #39002
Tests: