syun64 opened a new pull request, #305: URL: https://github.com/apache/iceberg-python/pull/305
This addresses: https://github.com/apache/iceberg-python/issues/278 Added `UP037 [*] Remove quotes from type annotation` to ruff in order to support [Forward References: PEP-484](https://peps.python.org/pep-0484/#forward-references) As discussed in the issue, we are proposing to update the create_table API to: ``` def create_table( self, identifier: Union[str, Identifier], schema: Union[Schema, "pa.Schema"], location: Optional[str] = None, partition_spec: PartitionSpec = UNPARTITIONED_PARTITION_SPEC, sort_order: SortOrder = UNSORTED_SORT_ORDER, properties: Properties = EMPTY_DICT, ) -> Table: ... if isinstance(schema, pa.Schema): schema = pre_order_visit_pyarrow(schema, _ConvertToIcebergWithFreshIds()) ... # existing code ``` We will call the function like: ``` table: pa.Table catalog = load_catalog() catalog.create_table('some.table', schema=table.schema) ``` And use the previously proposed Visitor: https://github.com/syun64/iceberg-python/blob/preorder-fresh-schema/pyiceberg/io/pyarrow.py#L994 since [new_table_metadata](https://github.com/apache/iceberg-python/blob/46b25be424d1ef0f28778b0873c4d91bf117a2a7/pyiceberg/table/metadata.py#L399) has to take `field_id`ed Iceberg Schema as the input. -- 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 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