-
Notifications
You must be signed in to change notification settings - Fork 279
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
Update core.py #303
Update core.py #303
Conversation
import Literal, Match and TypedDicr from "typing" instead of "typing_extensions"
Please enable Github actions in your repository and run the CI tests. I am pretty sure this fails on Python 3.7 |
yeah, actually this is for python >= 3.10 because it is failing there. Can you update python version to at least 3.9 for this one. |
Is there a problem at the moment with Python 3.10 or is this just to simplify the code? |
yes with python 3.10, it is throwing error that "cannot import Match from typing_extensions". importing from "typing" should fix the issue. (using latest version of typing_extensions) |
I can't reproduce this on Python 3.10 with latest There was a similar issue raised previously: #301 They solved it:
|
For me it's not getting resolved after restarting databricks notebook. I created this PR using the following issue reference: |
The typing_extensions source code has Could you check that import typing_extensions
print(typing_extensions.__all__)
import importlib.metadata
print(importlib.metadata.version('typing-extensions')) |
python==3.10 still getting error: cannot import name Match from typing_extensions |
I think this is a bug in databricks then, maybe open a bug report with them. |
Maybe it is possible to remove the dependency for if is_old_python_version:
from typing_extensions import Literal, Match, TypedDict
else:
from typing import Literal, Match, TypedDict I'll look into it. Dropping older Python version is not an option, there are still too many people using them. Download stats for last month on pypi.org for emoji package:
Date range: 2024-08-01 - 2024-08-31 |
if this is possible, this will be really helpful. Let me know when you can implement this, I kind of need this at the earliest for my project. Let me know if I can help somewhere. |
check for python version if less than 3.9 then import from typing_extension else import from typing
typing_extensions is also imported in the files tests/test_core.py and in utils/testutils.py. Could you make similar changes there as well? I'll test it today or tomorrow and then it can be released. |
abovesaid changes are done, waiting for testing and release |
@Aaryanverma Thank you! Something went wrong with this pull request, not sure what exactly, you can just close this pull request. I have merged your changes into a new pull request: #307 |
Closing this PR as abovesaid changes are merged in this one: #307 |
import Literal, Match and TypedDict from "typing" instead of "typing_extensions"