| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
The updates to the example dags look good. But I didn't expect to see source code changes here (and those are failing some mypy checks)
Sorry, something went wrong.
Please elaborate. This new ruff inspection I'm working on is a "best practices" change.
I'll address those as soon as I can |
Sorry, something went wrong.
Yes the best practice ruff change looks great :) I just expected updates to Dags only (to fix cases the new rule would have caught). I'm not sure why any changes happened to actual src code (in this case the normalise_json_content code). Is that because that function is called downstream inside the operator in the databricks Dag you updated?
Sounds good! 😄 |
Sorry, something went wrong.
This is because a certain unit test was asserting an implementation detail: File "/opt/airflow/providers/databricks/tests/system/databricks/example_databricks.py", line 118, in <module>
run_now = DatabricksRunNowOperator(
File "/opt/airflow/task-sdk/src/airflow/sdk/bases/operator.py", line 548, in apply_defaults
result = func(self, **kwargs, default_args=default_args)
File "/opt/airflow/providers/databricks/src/airflow/providers/databricks/operators/databricks.py", line 897, in __init__
self.json = normalise_json_content(self.json)
File "/opt/airflow/providers/databricks/src/airflow/providers/databricks/utils/databricks.py", line 45, in normalise_json_content
return {k: normalise(v, f"{json_path}[{k}]") for k, v in content.items()}
File "/opt/airflow/providers/databricks/src/airflow/providers/databricks/utils/databricks.py", line 45, in <dictcomp>
return {k: normalise(v, f"{json_path}[{k}]") for k, v in content.items()}
File "/opt/airflow/providers/databricks/src/airflow/providers/databricks/utils/databricks.py", line 48, in normalise_json_content
raise AirflowException(msg)
airflow.sdk.exceptions.AirflowException: Type <class 'airflow.sdk.definitions.xcom_arg.PlainXComArg'> used for parameter json[job_id] is not a number or a string
And Claude's analysis of this was: The AIR004 fix changed job_id from a Jinja template string to jobs_create_named.output (a PlainXComArg). But the operator's __init__ calls normalise_json_content(self.json) at parse time, which doesn't handle XComArg objects — it only accepts strings, numbers, booleans, lists, and dicts. |
Sorry, something went wrong.
Thanks for the context and details :) |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This PR addresses violations detected by the ruff-ecosystem CI check in the context of a newly proposed ruff rule (currently known as "AIR004").
Related: astral-sh/ruff#23583, #43176
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code Opus 4.6 following the guidelines