kevinjqliu commented on issue #1798:
URL:
https://github.com/apache/iceberg-python/issues/1798#issuecomment-2764703747
interesting, thanks for the code! I can reproduce the issue.
heres a working version, note how the schema used for create table and
append are all aligned
```
# working
from pyiceberg.catalog import load_catalog
import pyarrow as pa
catalog = load_catalog(**dict(type="in-memory"))
df_1 = pa.Table.from_pylist([
{"name": "one", "my_list": ["test"]},
{"name": "another", "my_list": ["test"]},
])
pyarrow_schema = df_1.schema
# create table
catalog.create_namespace_if_not_exists("test")
catalog.create_table_if_not_exists("test.table", pyarrow_schema)
# append data
catalog.load_table("test.table").append(df_1)
catalog.load_table("test.table").scan().to_arrow()
# append more data
df_2 = pa.Table.from_pylist([
{"name": "one"},
{"name": "another"},
], schema=pyarrow_schema)
catalog.load_table("test.table").append(df_2)
catalog.load_table("test.table").scan().to_arrow()
```
--
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]