Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MCPN committed Oct 16, 2024
1 parent ace268a commit 34b95a0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/dl_api_lib/dl_api_lib/dataset/base_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,14 @@ def get_backend_type(self) -> SourceBackendType:
return self._capabilities.get_backend_type(role=self.resolve_role())

def _reload_sources(self) -> None:
self._has_sources = bool(self._ds.get_single_data_source_id())
# resolve database characteristics
# never go to database from here --> only_cache=True
if self._has_sources:
if (source_id := self._ds.get_single_data_source_id()) is not None:
self._has_sources = True
role = self.resolve_role()
try:
backend_type = self._capabilities.get_backend_type(role=role)
dialect_name = resolve_dialect_name(backend_type=backend_type)
source_id = self._ds.get_single_data_source_id()
dsrc = self._get_data_source_strict(source_id=source_id, role=role)
db_info = dsrc.get_cached_db_info()
db_version = db_info.version
Expand All @@ -281,6 +280,8 @@ def _reload_sources(self) -> None:
)
except ReferencedUSEntryNotFound:
self.dialect = D.DUMMY
else:
self._has_sources = False

if self._query_spec is not None:
self.load_exbuilders()
Expand Down

0 comments on commit 34b95a0

Please sign in to comment.