Skip to content

Databricks SQL fails on Python 3.10 #22220

@potiuk

Description

@potiuk

Apache Airflow Provider(s)

databricks

Versions of Apache Airflow Providers

The databricks SQL does not work on Python 3.10 due to "from collections import Iterable" in the databricks-sql-connector

Details of this issue dicussed in #22050

For now we will likely just exclude the tests (and mark databricks provider as non-python 3.10 compatible). But once this is fixed (in either 1.0.2 or upcoming 2.0.0 version of the library, we wil restore it back).

Apache Airflow version

main (development)

Operating System

All

Deployment

Other

Deployment details

Just Breeze with Python 3.10

What happened

The tests are failing:

  self = <databricks.sql.common.ParamEscaper object at 0x7fe81c6dd6c0>
  item = ['file1', 'file2', 'file3']
  
      def escape_item(self, item):
          if item is None:
              return 'NULL'
          elif isinstance(item, (int, float)):
              return self.escape_number(item)
          elif isinstance(item, basestring):
              return self.escape_string(item)
  >       elif isinstance(item, collections.Iterable):
  E       AttributeError: module 'collections' has no attribute 'Iterable'

https://github.com/apache/airflow/runs/5523057543?check_suite_focus=true#step:8:16781

What you expected to happen

Test succeed :)

How to reproduce

Run TestDatabricksSqlCopyIntoOperator in Python 3.10 environment.

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions