sivaraman-ai opened a new issue, #1088:
URL: https://github.com/apache/iceberg-python/issues/1088

   ### Apache Iceberg version
   
   0.6.1
   
   ### Please describe the bug ๐Ÿž
   
   while writing dataframe to iceberg through tbl.append(df), there happens to 
be a schema validation of table schema & df schema.
   
   this function in append `_check_schema_compatible(self.schema(), 
other_schema=df.schema)` does the schema validation.
   
   here table schema & df schema are converted to pyarrow schema of struct 
type, and compared with order of columns with data types.
   
   this results in the following error:
   `Traceback (most recent call last):
     File 
"/Users/apple/Projects/bright/brightmoney_collections_system/utils/index.py", 
line 172, in <module>
       dff = write_to_iceberg(
     File 
"/Users/apple/Projects/bright/brightmoney_collections_system/utils/index.py", 
line 163, in write_to_iceberg
       table.append(pyarrow_df)
     File 
"/Users/apple/Projects/bright/brightmoney_collections_system/venv/lib/python3.9/site-packages/pyiceberg/table/__init__.py",
 line 1057, in append
       _check_schema_compatible(self.schema(), other_schema=df.schema)
     File 
"/Users/apple/Projects/bright/brightmoney_collections_system/venv/lib/python3.9/site-packages/pyiceberg/table/__init__.py",
 line 175, in _check_schema_compatible
       raise ValueError(f"Mismatch in fields:\n{console.export_text()}")
   ValueError: Mismatch in fields:
   
โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
   โ”ƒ    โ”ƒ Table field                             โ”ƒ Dataframe field             
            โ”ƒ
   
โ”กโ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
   โ”‚ โœ… โ”‚ 1: a: optional timestamptz     โ”‚ 1: a: optional timestamptz     โ”‚
   โ”‚ โœ… โ”‚ 2: b: optional timestamptz    โ”‚ 2: b: optional timestamptz    โ”‚
   โ”‚ โœ… โ”‚ 3: x: optional string          โ”‚ 3: x: optional string          โ”‚
   โ”‚ โœ… โ”‚ 4: y: optional string     โ”‚ 4: y: optional string     โ”‚
   
โ””โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜`
   
   yet there is no mismatch in field of table & dataframe.
   
   ideally the schema compatibility should not consider the order in which 
dataframe is send?
   
   
   
   
   


-- 
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: issues-unsubscr...@iceberg.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to