Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use typing_extension instead #17174

Merged
merged 1 commit into from
Oct 20, 2021
Merged

fix: use typing_extension instead #17174

merged 1 commit into from
Oct 20, 2021

Conversation

hughhhh
Copy link
Member

@hughhhh hughhhh commented Oct 20, 2021

SUMMARY

Use from typing_extensions import Literal instead of from typing import Literal to support legacy versions of python

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@hughhhh hughhhh changed the title use typing_extension instead fix: use typing_extension instead Oct 20, 2021
TYPE_CHECKING,
Union,
)
from typing import Any, Callable, Dict, List, Optional, Type, TYPE_CHECKING, Union
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this compatible with 3.8 AND 3.7?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup

➜ python3.7
Python 3.7.12 (default, Oct 13 2021, 06:53:03)
[Clang 13.0.0 (clang-1300.0.29.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from typing import (
    Any,
    Callable,
    Dict,
    List,
    Literal,
    Optional,
    Type,
    TYPE_CHECKING,
    Union,
)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'Literal' from 'typing' (/usr/local/Cellar/python@3.7/3.7.12_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/typing.py)
>>> from typing import (
    Any,
    Callable,
    Dict,
    List,
    Optional,
    Type,
    TYPE_CHECKING,
    Union,
)

@codecov
Copy link

codecov bot commented Oct 20, 2021

Codecov Report

Merging #17174 (f3282cb) into master (f580f6b) will decrease coverage by 0.13%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #17174      +/-   ##
==========================================
- Coverage   76.83%   76.69%   -0.14%     
==========================================
  Files        1039     1039              
  Lines       55561    55562       +1     
  Branches     7570     7570              
==========================================
- Hits        42690    42615      -75     
- Misses      12621    12697      +76     
  Partials      250      250              
Flag Coverage Δ
hive ?
javascript 70.93% <ø> (+<0.01%) ⬆️
mysql 81.91% <100.00%> (+<0.01%) ⬆️
postgres 81.92% <100.00%> (+<0.01%) ⬆️
python 82.00% <100.00%> (-0.27%) ⬇️
sqlite 81.59% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset/config.py 91.50% <100.00%> (+0.02%) ⬆️
superset/db_engines/hive.py 0.00% <0.00%> (-85.19%) ⬇️
superset/db_engine_specs/hive.py 69.76% <0.00%> (-17.06%) ⬇️
superset/views/database/mixins.py 81.03% <0.00%> (-1.73%) ⬇️
superset/db_engine_specs/presto.py 83.47% <0.00%> (-0.84%) ⬇️
superset/db_engine_specs/base.py 88.17% <0.00%> (-0.39%) ⬇️
superset/connectors/sqla/models.py 85.68% <0.00%> (-0.24%) ⬇️
superset/utils/core.py 89.97% <0.00%> (-0.12%) ⬇️
...eFilters/FiltersConfigModal/FiltersConfigModal.tsx 87.50% <0.00%> (+0.59%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f580f6b...f3282cb. Read the comment docs.

@hughhhh hughhhh merged commit aa0f4d6 into master Oct 20, 2021
henryyeh pushed a commit to preset-io/superset that referenced this pull request Oct 20, 2021
@sadpandajoe
Copy link
Member

🏷️ 2021.40

sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Oct 22, 2021
@eschutho eschutho added the v1.4 label Oct 26, 2021
eschutho pushed a commit to preset-io/superset that referenced this pull request Oct 27, 2021
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
@mistercrunch mistercrunch added 🍒 1.4.0 🍒 1.4.1 🍒 1.4.2 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.5.0 labels Mar 13, 2024
@mistercrunch mistercrunch deleted the fix-literal branch March 26, 2024 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels preset:2021.40 size/S v1.4 🍒 1.4.0 🍒 1.4.1 🍒 1.4.2 🚢 1.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants