Skip to content

Commit

Permalink
refactor: trigger metadata retrieval only during DeltaTable.metadata (
Browse files Browse the repository at this point in the history
#1979)

# Description
Triggers metadata retrieval only on metadata call, this is a better
approach otherwise we need to add it after each method that does an
alteration to the table config. Also now it will only be triggered if
the user actually wants to retrieve the metadata.

Co-authored-by: Robert Pack <42610831+roeap@users.noreply.github.com>
  • Loading branch information
ion-elgreco and roeap authored Dec 19, 2023
1 parent df04624 commit 4ece26d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions python/deltalake/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ def __init__(
without_files=without_files,
log_buffer_size=log_buffer_size,
)
self._metadata = Metadata(self._table)

@classmethod
def from_data_catalog(
Expand Down Expand Up @@ -499,7 +498,7 @@ def metadata(self) -> Metadata:
Returns:
the current Metadata registered in the transaction log
"""
return self._metadata
return Metadata(self._table)

def protocol(self) -> ProtocolVersions:
"""
Expand Down

0 comments on commit 4ece26d

Please sign in to comment.