DavidEscott opened a new issue, #2030:
URL: https://github.com/apache/iceberg-python/issues/2030

   ### Apache Iceberg version
   
   0.9.0
   
   ### Please describe the bug 🐞
   
   I can't figure out how one is actually expected to create a table from a 
pyarrow schema.
   
   For this use case I have a pandas or polars table that I have directly 
created a pyarrow schema from. I would like to create a new empty table from 
this virgin pyarrow schema. It has no field ids and I would like pyiceberg to 
generate them.
   
   `io.pyarrow.pyarrow_to_schema` would seem to be the way to convert the 
schema to an iceberg schema. It first calls the _HasIds() visitor, this is 
seemingly returning False because the schema doesn't have ids.
   
   Next is to try and apply the name_mapping, but I don't want to provide a 
name_mapping.
   
   It then fails warning me that the table doesn't have `the Iceberg table does 
not have 'schema.name-mapping.default' defined`, which is circular as I don't 
have a table yet.
   
   -----
   
   It seems like pyarrow_to_schema is missing a case where one would apply the 
`_ConvertToIcebergWithoutIDs` visitor to the arrow schema as is done in 
`pyiceberg.catalog.__init__.py`    `_convert_schema_if_needed`
   
   Is there some reason we are not supposed to build tables this way?
   
   
   
   
   ### 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


-- 
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