lolloz98 commented on issue #2590:
URL:
https://github.com/apache/iceberg-python/issues/2590#issuecomment-3393863162
> It doesn't necessarily have to be pyiceberg==0.9.1. Any pyiceberg version
with pydantic < 2.12 will work.
>
> Here's a simple script to check:
>
> ```
> uv run --with 'pyiceberg[pyarrow,sql-sqlite]' --with 'pydantic<2.12'
python - <<'PY'
> import pyiceberg, pydantic, pyarrow as pa
> print(f"pyiceberg.__version__ = {pyiceberg.__version__}")
> print(f"pydantic.__version__ = {pydantic.__version__}")
>
> from pyiceberg.catalog import load_catalog
>
> catalog = load_catalog("catalog", type="in-memory")
> catalog.create_namespace_if_not_exists("default")
>
> data = pa.table({"x": [1, 2, 3], "y": [4, 5, 6]})
> iceberg_table = catalog.create_table("default.test", schema=data.schema)
> iceberg_table.append(data)
>
> print("Table created and data appended successfully.")
> print(len(iceberg_table.scan().to_arrow()))
> PY
> ```
>
> outputs:
>
> ```
> pyiceberg.__version__ = 0.10.0
> pydantic.__version__ = 2.11.10
> Table created and data appended successfully.
> 3
> ```
>
> removing the `--with 'pydantic<2.12'` will default back to the latest
pydantic version, which is 2.12, and will fail the script
Alternatively you can also install the previous pydantic after install
pyiceberg (that should override the broken pydantic version)
e.g. pip install pydantic==2.11.10
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]