Skip to content

Commit

Permalink
Skip some tests for Databricks from running on Python 3.10 (#22221)
Browse files Browse the repository at this point in the history
This is a temporary measure until the Databricks SQL library
is released in Python 3.10 - compatible version.

Related to: #22220
  • Loading branch information
potiuk committed Mar 13, 2022
1 parent a840561 commit af9d85c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions airflow/providers/databricks/provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ versions:
additional-dependencies:
- apache-airflow>=2.1.0

excluded-python-versions:
- "3.10"

integrations:
- integration-name: Databricks
external-doc-url: https://databricks.com/
Expand Down
8 changes: 7 additions & 1 deletion tests/providers/databricks/operators/test_databricks_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import pytest
from databricks.sql.types import Row

from airflow import AirflowException
from airflow import PY310, AirflowException
from airflow.providers.databricks.operators.databricks_sql import (
DatabricksCopyIntoOperator,
DatabricksSqlOperator,
Expand Down Expand Up @@ -83,6 +83,12 @@ def test_exec_write_file(self, db_mock_class):
db_mock.run.assert_called_once_with(sql, parameters=None)


@pytest.mark.skipif(
PY310,
reason="Databricks SQL tests not run on Python 3.10 because there is direct Iterable import from"
" collections in the databricks SQL library, where it should be imported from collections.abc."
" This could be removed when https://github.com/apache/airflow/issues/22220 is solved",
)
class TestDatabricksSqlCopyIntoOperator(unittest.TestCase):
def test_copy_with_files(self):
op = DatabricksCopyIntoOperator(
Expand Down

0 comments on commit af9d85c

Please sign in to comment.