Skip to content

Commit

Permalink
Merge branch 'master' into 2024-12-11-fix-ara-bauwerk-export-2nd-attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
sjib committed Dec 20, 2024
2 parents a00ce7a + 43f8e9b commit 1e42ed4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 23 deletions.
3 changes: 3 additions & 0 deletions qgepqwat2ili/tests/test_qgep.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ def test_case_f_export_selection_sia405(self):
# F. export a selection
"""

# Prepare db
main(["setupdb", "full"])

path = os.path.join(tempfile.mkdtemp(), "export_VSA_KEK_2019_LV95.xtf")
selection = [
# reach_id
Expand Down
40 changes: 17 additions & 23 deletions qgepqwat2ili/utils/ili2db.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ def check_organisation_subclass_data():
organisation_count = organisation_count - cursor.rowcount

if organisation_count == 0:
organisation_subclass_check = True
logger.info(
"OK: number of subclass elements of class organisation OK in schema qgep_od!"
)
return True
else:
organisation_subclass_check = False
logger.info(
logger.error(
f"ERROR: number of subclass elements of organisation NOT CORRECT in schema qgep_od: checksum = {organisation_count} (positiv number means missing entries, negativ means too many subclass entries)"
)
return False

return organisation_subclass_check
return True


def check_wastewater_structure_subclass_data():
Expand Down Expand Up @@ -78,17 +78,17 @@ def check_wastewater_structure_subclass_data():
wastewater_structure_count = wastewater_structure_count - cursor.rowcount

if wastewater_structure_count == 0:
wastewater_structure_subclass_check = True
logger.info(
"OK: number of subclass elements of class wastewater_structure OK in schema qgep_od!"
)
return True
else:
wastewater_structure_subclass_check = False
logger.info(
logger.error(
f"ERROR: number of subclass elements of wastewater_structure NOT CORRECT in schema qgep_od: checksum = {wastewater_structure_count} (positiv number means missing entries, negativ means too many subclass entries)"
)
return False

return wastewater_structure_subclass_check
return True


def check_identifier_null():
Expand Down Expand Up @@ -260,15 +260,13 @@ def check_fk_operator_null():
logger.info(f"missing_fk_operator_count : {missing_fk_operator_count}")

if missing_fk_operator_count == 0:
check_fk_operator_null = True
logger.info("OK: all mandatory fk_operator set in qgep_od!")
return True
else:
check_fk_operator_null = False
logger.info(
logger.error(
f"ERROR: Missing mandatory fk_operator in qgep_od: {missing_fk_operator_count}"
)

return check_fk_operator_null
return False


def check_fk_dataowner_null():
Expand Down Expand Up @@ -349,15 +347,13 @@ def check_fk_dataowner_null():
logger.info(f"missing_fk_dataowner_count : {missing_fk_dataowner_count}")

if missing_fk_dataowner_count == 0:
check_fk_dataowner_null = True
logger.info("OK: all mandatory fk_dataowner set in qgep_od!")
return True
else:
check_fk_dataowner_null = False
logger.info(
logger.error(
f"ERROR: Missing mandatory fk_dataowner in qgep_od: {missing_fk_dataowner_count}"
)

return check_fk_dataowner_null
return False


def check_fk_provider_null():
Expand Down Expand Up @@ -437,15 +433,13 @@ def check_fk_provider_null():
logger.info(f"missing_fk_provider_count : {missing_fk_provider_count}")

if missing_fk_provider_count == 0:
check_fk_provider_null = True
logger.info("OK: all mandatory fk_provider set in qgep_od!")
return True
else:
check_fk_provider_null = False
logger.info(
logger.error(
f"ERROR: Missing mandatory fk_provider in qgep_od: {missing_fk_provider_count}"
)

return check_fk_provider_null
return False


def skip_wwtp_structure_ids():
Expand Down

0 comments on commit 1e42ed4

Please sign in to comment.