You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "uranusjr (via GitHub)" <gi...@apache.org> on 2023/08/20 02:08:10 UTC
[GitHub] [airflow] uranusjr commented on a diff in pull request #33541: Refactor: use tmp_path in databricks test
uranusjr commented on code in PR #33541:
URL: https://github.com/apache/airflow/pull/33541#discussion_r1299288795
##########
tests/providers/databricks/operators/test_databricks_sql.py:
##########
@@ -268,16 +266,18 @@ def test_return_value_serialization():
),
],
)
-def test_exec_write_file(return_last, split_statements, sql, descriptions, hook_results, do_xcom_push):
+def test_exec_write_file(
+ return_last, split_statements, sql, descriptions, hook_results, do_xcom_push, tmp_path
+):
"""
Test the execute function in case where SQL query was successful and data is written as CSV
"""
with patch("airflow.providers.databricks.operators.databricks_sql.DatabricksSqlHook") as db_mock_class:
- tempfile_path = tempfile.mkstemp()[1]
+ path = tmp_path / "testfile"
op = DatabricksSqlOperator(
task_id=TASK_ID,
sql=sql,
- output_path=tempfile_path,
+ output_path=path,
Review Comment:
```suggestion
output_path=os.fspath(path),
```
or alternatively DatabricksSqlOperator should be modified to support Path.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org