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

Compatibility Issue with pydantic and annotated-types in pyiceberg 0.8.1 #1418

Open
2 of 3 tasks
pawansanz opened this issue Dec 9, 2024 · 5 comments
Open
2 of 3 tasks

Comments

@pawansanz
Copy link

pawansanz commented Dec 9, 2024

Apache Iceberg version

0.8.1 (latest release)

Please describe the bug 🐞

I am encountering an error when using pyiceberg 0.8.1 with pydantic 2.10.3 and annotated-types 0.7.0 in a Python virtual environment. The error message is:

File "\site-packages\pydantic\types.py", line 898, in conlist
return Annotated[List[item_type], annotated_types.Len(min_length or 0, max_length)]
TypeError: Len() takes no arguments

Environment:
OS: Windows 10
Python Version: 3.10
pyiceberg Version: 0.8.1
pydantic Version: 2.10.3
annotated-types Version: 0.7.0

Additional Notes:

I have ensured the latest versions of pydantic and annotated-types are installed, and the error still persists.
Cleaning the environment and reinstalling dependencies did not resolve the issue.

Willingness to contribute

  • I can contribute a fix for this bug independently
  • I would be willing to contribute a fix for this bug with guidance from the Iceberg community
  • I cannot contribute a fix for this bug at this time
@djouallah
Copy link

got this error too

ImportError: cannot import name 'RootModel' from 'pydantic' (/home/trusted-service-user/jupyter-env/python3.11/lib/python3.11/site-packages/pydantic/__init__.cpython-311-x86_64-linux-gnu.so)

@Fokko
Copy link
Contributor

Fokko commented Dec 10, 2024

@djouallah do you know which version of Pydantic you're using? You can easily check it using:

Python 3.10.14 (main, Mar 19 2024, 21:46:16) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pydantic 
>>> pydantic.__version__
'2.10.3'

@djouallah
Copy link

@djouallah do you know which version of Pydantic you're using? You can easily check it using:

Python 3.10.14 (main, Mar 19 2024, 21:46:16) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pydantic 
>>> pydantic.__version__
'2.10.3'

sorry, my notebook did not properly restarted, everything is fine

@pawansanz
Copy link
Author

can anyone help with original issue that was reported regarding "Apache Iceberg version"

@kevinjqliu
Copy link
Contributor

Hi @pawansanz, I've also encountered this issue before. In my case, it was due to the different library versions on my laptop.
A way to debug is to ensure that the python,poetry, and pydantic all refer to the same python virtual environment.

Could you try recreating the python virtual environment and see if the issue persists?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants