Skip to content

Commit b245e56

Browse files
committed
fix wrong return type
1 parent f3c69a0 commit b245e56

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

modelbaker/dbconnector/db_connector.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,11 @@ def get_attrili_attrdb_mapping_by_owner(self, owners: list[str]) -> dict:
280280
"""Used for ili2db version 3"""
281281
return {}
282282

283-
def get_models(self) -> dict:
283+
def get_models(self) -> list[dict]:
284284
"""
285285
Returns the models in use, the ili-file content and the direct parents of the model.
286286
"""
287-
return {}
287+
return []
288288

289289
def ili_version(self) -> str:
290290
"""
@@ -399,12 +399,12 @@ def edit_basket(self, basket_config: dict) -> tuple[bool, str]:
399399
"""
400400
return False, None
401401

402-
def get_tid_handling(self) -> dict:
402+
def get_tid_handling(self) -> bool:
403403
"""
404404
Returns `True` if a tid handling is enabled according to the settings table (when the database has been created with `--createTidCol`).
405405
If t_ili_tids are used only because of a stable id definition in the model (with `OID as` in the topic or the class definition), this parameter is not set and this function will return `{}`.
406406
"""
407-
return {}
407+
return False
408408

409409
def get_ili2db_settings(self) -> dict:
410410
"""

modelbaker/dbconnector/gpkg_connector.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -711,9 +711,9 @@ def get_attrili_attrdb_mapping_by_owner(self, owners: list[str]) -> dict:
711711
)
712712
return cursor
713713

714-
def get_models(self) -> dict:
714+
def get_models(self) -> list[dict]:
715715
if not self._table_exists("T_ILI2DB_TRAFO"):
716-
return {}
716+
return []
717717

718718
# Get MODELS
719719
cursor = self.conn.cursor()
@@ -1105,7 +1105,7 @@ def edit_basket(self, basket_config: dict) -> tuple[bool, str]:
11051105
'Could not edit basket for topic "{}" and dataset "{}"'
11061106
).format(basket_config["topic"], basket_config["datasetname"])
11071107

1108-
def get_tid_handling(self) -> dict:
1108+
def get_tid_handling(self) -> bool:
11091109
if self._table_exists(GPKG_SETTINGS_TABLE):
11101110
cursor = self.conn.cursor()
11111111
cursor.execute(

modelbaker/dbconnector/mssql_connector.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -763,9 +763,9 @@ def get_iliname_dbname_mapping(self, sqlnames: list[str] = []) -> dict:
763763

764764
return result
765765

766-
def get_models(self) -> dict:
766+
def get_models(self) -> list[dict]:
767767
if not self._table_exists("t_ili2db_trafo"):
768-
return {}
768+
return []
769769

770770
# Get MODELS
771771
if self.schema:
@@ -808,7 +808,7 @@ def get_models(self) -> dict:
808808
list_result.append(result)
809809
result = dict()
810810
return list_result
811-
return {}
811+
return []
812812

813813
def get_classili_classdb_mapping(self, models_info, extended_classes):
814814
result = {}
@@ -1184,7 +1184,7 @@ def edit_basket(self, basket_config: dict) -> tuple[bool, str]:
11841184
'Could not edit basket for topic "{}" and dataset "{}"'
11851185
).format(basket_config["topic"], basket_config["datasetname"])
11861186

1187-
def get_tid_handling(self) -> dict:
1187+
def get_tid_handling(self) -> bool:
11881188
if self.schema and self._table_exists(SETTINGS_TABLE):
11891189
cur = self.conn.cursor()
11901190
cur.execute(

modelbaker/dbconnector/pg_connector.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -915,9 +915,9 @@ def get_attrili_attrdb_mapping_by_owner(self, owners: list[str]) -> dict:
915915

916916
return {}
917917

918-
def get_models(self) -> dict:
918+
def get_models(self) -> list[dict]:
919919
if not self._table_exists("t_ili2db_trafo"):
920-
return {}
920+
return []
921921

922922
# Get MODELS
923923
if self.schema:
@@ -964,7 +964,7 @@ def get_models(self) -> dict:
964964
result = dict()
965965

966966
return list_result
967-
return {}
967+
return []
968968

969969
def ili_version(self) -> str:
970970
cur = self.conn.cursor()
@@ -1282,7 +1282,7 @@ def edit_basket(self, basket_config: dict) -> tuple[bool, str]:
12821282
'Could not edit basket for topic "{}" and dataset "{}"'
12831283
).format(basket_config["topic"], basket_config["datasetname"])
12841284

1285-
def get_tid_handling(self) -> dict:
1285+
def get_tid_handling(self) -> bool:
12861286
if self.schema and self._table_exists(PG_SETTINGS_TABLE):
12871287
cur = self.conn.cursor()
12881288
cur.execute(

0 commit comments

Comments
 (0)