Hey team! I'm running into the below error while t...
# hamilton-help
s
Hey team! I'm running into the below error while trying to import,
from hamilton.function_modifiers import parameterize, source
Copy code
File "/home/sahil/repos/TNP_Atlas/.venv/lib/python3.11/site-packages/hamilton/data_quality/default_validators.py", line 520, in _append_pydantic_to_default_validators
    from hamilton.data_quality import pydantic_validators
  File "/home/sahil/repos/TNP_Atlas/.venv/lib/python3.11/site-packages/hamilton/data_quality/pydantic_validators.py", line 3, in <module>
    from pydantic import BaseModel, TypeAdapter, ValidationError
ImportError: cannot import name 'TypeAdapter' from 'pydantic' (/home/sahil/repos/TNP_Atlas/.venv/lib/python3.11/site-packages/pydantic/__init__.cpython-311-x86_64-linux-gnu.so)
Pydantic version: 1.10.18 (incompatible version?) Any suggestions are welcome. Thanks!
e
Hey! So we recently released a pydantic extension that uses TypeAdapter, a pydantic 2.0 feature
Is upgrading to 2 doable for you? We might also want to look at making it so it doesn’t fail on 1.0
f
I also hit this...currently need to fix either here or the place where I need < 2, so if a fix is easy then a good idea!
t
should be a quick fix, we'll get this done today! Sorry for the inconvenience
👍 1
s
@Elijah Ben Izzy -- i see, sadly not. I need to stick with pydantic < 2, lot of inter dependencies.
that's great, thanks @Thierry Jean!
e
Yeah fixing is reasonable
👍 1
s
or a version that doesn't use the TypeAdapter? I'm on 1.77.0
e
In the meanwhile for a workaround downgrade one version — we’ll have a patch fix out shortly! Sorry for the confusion.
👍 1
s
for those following here’s a summary: • we pushed new pydantic validator — it assumed a pydantic 2.0 feature • if you have pydantic in your environment, we tried to load the new pydantic validator ◦ if you had pydantic <2.0 the import broke and errored out If you’re blocked right now, the fix is to use
sf-hamilton==1.76.0
or upgrade to pydantic 2.0+. Otherwise if you can wait a few hours we’ll have
1.77.1
out that will address this issue.
👍 1
e
Hey folks! Released
sf-hamilton==1.77.1
— see this: https://hamilton-opensource.slack.com/archives/C03AJNGDGQL/p1727118147767499. We’ve tested it but would love confirmation that it solves your issues — let us know if the problems go away!
👍 1
🙌 2
s
@sahil-shetty @Fran Boon ^
f
Works for me - tyvm...amazing response time as always 🙂
❤️ 2
e
You got it!
Thanks @Thierry Jean for the quick fix 🫡
😁 1
s
works now team, thanks a lot for the quick fix! 🙌
🙌 2