Skip to content

Commit

Permalink
Fix logic for checking if object exists (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
iadrich authored May 19, 2023
1 parent a634e3d commit 96f6339
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sayn/database/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ def load_data(
ddl = result.value

check_create = True
table_exists_prior_load = self._object_exists(table, schema, db)
table_exists_prior_load = self._table_exists(table, schema)

records_loaded = 0
for i, record in enumerate(data):
Expand Down Expand Up @@ -617,7 +617,10 @@ def _object_exists(
if db in self._requested_objects:
if schema in self._requested_objects[db]:
if object_name in self._requested_objects[db][schema]:
return True
return (
self._requested_objects[db][schema][object_name]["type"]
is not None
)

return False

Expand Down

0 comments on commit 96f6339

Please sign in to comment.