From 65811281716e5f9f7a050112624e6cb74ae3a4a7 Mon Sep 17 00:00:00 2001 From: Jorrit Sandbrink Date: Tue, 17 Sep 2024 13:42:19 +0400 Subject: [PATCH] replace try_get_deltatable --- dlt/destinations/impl/filesystem/filesystem.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dlt/destinations/impl/filesystem/filesystem.py b/dlt/destinations/impl/filesystem/filesystem.py index c9f9797785..5d244020dd 100644 --- a/dlt/destinations/impl/filesystem/filesystem.py +++ b/dlt/destinations/impl/filesystem/filesystem.py @@ -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]: