kevinjqliu commented on code in PR #1642: URL: https://github.com/apache/iceberg-python/pull/1642#discussion_r1951181666
########## pyiceberg/catalog/__init__.py: ########## @@ -746,6 +747,24 @@ def _convert_schema_if_needed(schema: Union[Schema, "pa.Schema"]) -> Schema: pass raise ValueError(f"{type(schema)=}, but it must be pyiceberg.schema.Schema or pyarrow.Schema") + @staticmethod + def metadata_file_location(table_location: str, file_name: str, properties: Properties = EMPTY_DICT) -> str: Review Comment: nit: should this be a Table static method, instead of a Catalog one? I think Table makes sense to me esp since we're reading TableProperties ########## pyiceberg/table/update/snapshot.py: ########## @@ -243,13 +233,8 @@ def _commit(self) -> UpdatesAndRequirements: next_sequence_number = self._transaction.table_metadata.next_sequence_number() summary = self._summary(self.snapshot_properties) - - manifest_list_file_path = _generate_manifest_list_path( - location=self._transaction.table_metadata.location, - snapshot_id=self._snapshot_id, - attempt=0, - commit_uuid=self.commit_uuid, - ) + file_name = f"{self.commit_uuid}-m{self._snapshot_id}-a0.avro" + manifest_list_file_path = self._transaction._table.metadata_file_location(file_name) Review Comment: is this the same as `_generate_manifest_list_path`? `_generate_manifest_list_path` was using ``` return f"{location}/metadata/snap-{snapshot_id}-{attempt}-{commit_uuid}.avro" ``` aside from `{location}/metadata` which we are changing, the rest should stay the same. ########## pyiceberg/table/update/snapshot.py: ########## @@ -295,13 +280,9 @@ def new_manifest_writer(self, spec: PartitionSpec) -> ManifestWriter: ) def new_manifest_output(self) -> OutputFile: - return self._io.new_output( - _new_manifest_path( - location=self._transaction.table_metadata.location, - num=next(self._manifest_num_counter), - commit_uuid=self.commit_uuid, - ) - ) + file_name = f"{self.commit_uuid}-m{next(self._manifest_num_counter)}.avro" Review Comment: this is the same as `_new_manifest_path` 👍 ``` return f"{location}/metadata/{commit_uuid}-m{num}.avro" ``` ########## pyiceberg/table/update/snapshot.py: ########## @@ -243,13 +233,8 @@ def _commit(self) -> UpdatesAndRequirements: next_sequence_number = self._transaction.table_metadata.next_sequence_number() summary = self._summary(self.snapshot_properties) - - manifest_list_file_path = _generate_manifest_list_path( - location=self._transaction.table_metadata.location, - snapshot_id=self._snapshot_id, - attempt=0, - commit_uuid=self.commit_uuid, - ) + file_name = f"{self.commit_uuid}-m{self._snapshot_id}-a0.avro" + manifest_list_file_path = self._transaction._table.metadata_file_location(file_name) Review Comment: nit: should we keep `_generate_manifest_list_path` and make it generate the file path after `/metadata`, and then just use `.metadata_file_location()` to include the metadata prefix -- 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