dbt-labs / dbt-semantic-interfaces

The shared semantic layer definitions that dbt-core and MetricFlow use.
Apache License 2.0
71 stars 14 forks source link

Can't import override from typing_extensions~=4.0 #193

Closed Fatal1ty closed 1 year ago

Fatal1ty commented 1 year ago

Is this a new bug in dbt-semantic-interfaces?

Current Behavior

This package currently depends on typing-extensions~=4.0: https://github.com/dbt-labs/dbt-semantic-interfaces/blob/d919c0cb0b168df7f3edcbfa35287b14bf063424/pyproject.toml#L31

But here it uses override function which was introduced in typing-extensions 4.4.0: https://github.com/dbt-labs/dbt-semantic-interfaces/blob/d919c0cb0b168df7f3edcbfa35287b14bf063424/dbt_semantic_interfaces/transformations/names.py#L3

Since dbt-semantic-interfaces is a direct dependency for dbt-core, it causes ImportError when someone installs dbt-core with typing-extensions>=4.0,<4.4.0:

The solution is to stick to typing-extensions>=4.4.0 or typing-extensions~=4.4. I would prefer the first one because newer versions are getting bugs fixed and new features backported.

Expected Behavior

No ImportError raised.

Steps To Reproduce

  1. pip install dbt-semantic-interfaces
  2. pip install "typing-extensions>=4.0,<4.4.0"
  3. from dbt_semantic_interfaces.transformations import names

Relevant log output

No response

Environment

- OS: Any
- Python: Any
- dbt-semantic-interfaces: 0.3.0

Additional Context

No response