Skip to content

Commit e674172

Browse files
authored
Fix failing Databricks tests (#292)
Following tests for Databricks are failing and observed in a non-related PR: #290 1. test_databricks_submit_run_operator_async 2. test_databricks_run_now_operator_async The reason for failure is that the execute method called in these tests is trying to push an XCOM against task instance 'ti' of the context. Previously, context was an empty dictionary missing the 'ti' key. We now are using the create_context utility to generate a context object which includes the 'ti' key against which the XCOM is getting pushed.
1 parent 163f2dd commit e674172

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/databricks/operators/test_databricks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def test_databricks_submit_run_operator_async(
5656
)
5757

5858
with pytest.raises(TaskDeferred) as exc:
59-
operator.execute(context)
59+
operator.execute(context=create_context(operator))
6060

6161
assert isinstance(exc.value.trigger, DatabricksTrigger), "Trigger is not a DatabricksTrigger"
6262

@@ -80,7 +80,7 @@ def test_databricks_run_now_operator_async(
8080
)
8181

8282
with pytest.raises(TaskDeferred) as exc:
83-
operator.execute(context)
83+
operator.execute(context=create_context(operator))
8484

8585
assert isinstance(exc.value.trigger, DatabricksTrigger), "Trigger is not a DatabricksTrigger"
8686

0 commit comments

Comments
 (0)