smaheshwar-pltr commented on code in PR #4523:
URL: https://github.com/apache/iceberg-python/pull/4523#discussion_r4733701657


##########
pyiceberg/table/update/snapshot.py:
##########
@@ -422,12 +422,16 @@ def new_manifest_writer(self, spec: PartitionSpec) -> 
ManifestWriter:
         )
 
     def new_manifest_output(self) -> OutputFile:
-        location_provider = self._transaction._table.location_provider()
         file_name = 
_new_manifest_file_name(num=next(self._manifest_num_counter), 
commit_uuid=self.commit_uuid)
-        file_path = location_provider.new_metadata_location(file_name)
+        file_path = self._location_provider().new_metadata_location(file_name)
         self._written_manifests.append(file_path)
         return self._io.new_output(file_path)
 
+    def _location_provider(self) -> LocationProvider:
+        # Use the metadata of the transaction, as for data files, in case it 
changed the location or properties
+        table_metadata = self._transaction.table_metadata
+        return load_location_provider(table_location=table_metadata.location, 
table_properties=table_metadata.properties)

Review Comment:
   (Note that `self._transaction._table.location_provider()` which we had 
previously in `new_manifest_output` _calls_ `load_location_provider`, so this 
isn't a new load per-manifest)



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

Reply via email to