Skip to content

Commit

Permalink
replace try_get_deltatable
Browse files Browse the repository at this point in the history
  • Loading branch information
jorritsandbrink authored and sh-rp committed Sep 18, 2024
1 parent 42d77cc commit 6581128
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dlt/destinations/impl/filesystem/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,12 @@ def _storage_options(self) -> Dict[str, str]:
return _deltalake_storage_options(self._job_client.config)

def _delta_table(self) -> Optional["DeltaTable"]: # type: ignore[name-defined] # noqa: F821
from dlt.common.libs.deltalake import try_get_deltatable
from dlt.common.libs.deltalake import DeltaTable

return try_get_deltatable(self.make_remote_url(), storage_options=self._storage_options)
if DeltaTable.is_deltatable(self.make_remote_url(), storage_options=self._storage_options):
return DeltaTable(self.make_remote_url(), storage_options=self._storage_options)
else:
return None

@property
def _partition_columns(self) -> List[str]:
Expand Down

0 comments on commit 6581128

Please sign in to comment.