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

Can't import pyiceberg.catalog #500

Closed
leonidmakarovsky opened this issue Mar 6, 2024 · 3 comments
Closed

Can't import pyiceberg.catalog #500

leonidmakarovsky opened this issue Mar 6, 2024 · 3 comments

Comments

@leonidmakarovsky
Copy link

leonidmakarovsky commented Mar 6, 2024

Apache Iceberg version

0.6.0 (latest release)

Please describe the bug 🐞

Note that the previous version 0.5.1 does NOT have this issue.

Running on Mac OS Monterey 12.6.7, Spyder IDE (Python 3.9.7 64-bit | Qt 5.9.7 | PyQt5 5.9.2 | Darwin 21.6.0 )

When importing:
import pyiceberg.catalog
the following exception occurs:

Traceback (most recent call last):

File ~/Python/data-calc-service/untitled0.py:9
import pyiceberg.catalog

File ~/opt/anaconda3/lib/python3.9/site-packages/pyiceberg/catalog/init.py:45
from pyiceberg.table import (

File ~/opt/anaconda3/lib/python3.9/site-packages/pyiceberg/table/init.py:87
from pyiceberg.table.name_mapping import (

File ~/opt/anaconda3/lib/python3.9/site-packages/pyiceberg/table/name_mapping.py:38
class MappedField(IcebergBaseModel):

File ~/opt/anaconda3/lib/python3.9/site-packages/pyiceberg/table/name_mapping.py:40 in MappedField
names: List[str] = conlist(str, min_length=1)

File ~/opt/anaconda3/lib/python3.9/site-packages/pydantic/types.py:869 in conlist
return Annotated[List[item_type], annotated_types.Len(min_length or 0, max_length)]

TypeError: Len() takes no arguments

@kevinjqliu
Copy link
Contributor

seems like an issue related to pydantic library. What version of it do you have installed?

Here's my env setup using make install:

(venv) ➜  iceberg-python git:(main)  pip list | grep pydantic              
pydantic                   2.6.1
pydantic_core              2.16.2

@leonidmakarovsky
Copy link
Author

My python version is 3.9.7. My colleague told me that pyiceberg works with 3.9.11 and later. It didn't work with 3.9.7 in his env as well. I'm trying to upgrade Python and will update the ticket.

@kevinjqliu
Copy link
Contributor

Addressed in #526

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

2 participants