Open ondrej-ivanko opened 2 months ago
A workaround is using no_type_check
decorator from typing
from typing import no_type_check
from geojson_pydantic import FeatureCollection, Point
no_type_check(Point)
@ondrej-ivanko I guess you're using geojson-pydantic 0.6
I'll be happy to review any PR patching 0.6 with a fix 🙏
Hi,
when I was trying you package with one of the newest versions of FastaAPI which depends on typing-extension >=4.8.0, I ran into a typing error in your code. It applies I believe only to python version less than 3.10. There were changes to
Literal
which you're using in cases of some of your pydantic ModelsI have to use python 3.9 along with Pydantic 1.10.x for dependency purposes. Our company cannot raise the versions of some libraries without proper testing. Is it possible on you side to create new 0.6.x patch version, which uses typing which would work on Python 3.9.
I added links to the issue in Pydantic. https://github.com/pydantic/pydantic/issues/5824 https://github.com/python/typing_extensions/commit/fb37b2ee0ab56baf2dfd5df27aec0430435ba17f https://github.com/pydantic/pydantic/issues/5821#issuecomment-1558716103 https://github.com/pydantic/pydantic/issues/545#issuecomment-1573773542
for better location of error I added logs. It happens already when trying to import the Model
Point
code:
Thank you for your help.