amoghrajesh commented on code in PR #68974:
URL: https://github.com/apache/airflow/pull/68974#discussion_r3473861898
##########
providers/databricks/tests/unit/databricks/operators/test_databricks.py:
##########
@@ -1651,6 +1668,161 @@ def
test_inject_parent_job_info_preserves_existing_config(self, db_mock_class, m
assert
submitted["new_cluster"]["spark_conf"]["spark.openlineage.parentJobNamespace"]
== "ns"
[email protected](
+ not AIRFLOW_V_3_3_PLUS, reason="task_state_store (durable execution)
requires Airflow 3.3+"
+)
+class TestDatabricksSubmitRunOperatorDurable:
+ @staticmethod
+ def _context(task_store=None):
+ ctx: dict = {"ti": MagicMock(autospec=True)}
+ if task_store is not None:
+ ctx["task_state_store"] = task_store
+ return ctx
Review Comment:
Fixed. Replaced `MagicMock(autospec=True)` so the mixin's
`ti.stats_tags.get("team_name")` returns None instead of a truthy mock that
would pollute the metric tags. I did not add a full spec_set for the TI mock
since the runtime TaskInstance surface is large and specing it precisely would
be fragile; setting stats_tags explicitly addresses the actual issue here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]