QGEP / qgepqwat2ili

3 stars 3 forks source link

Data export fails while writing the xtf instead of during database schema creation #90

Closed kandre closed 7 months ago

kandre commented 1 year ago

Describe the bug Data export failed with not-null constraint errors while writing the xtf, however theses errors were not detected during previous step when postgis schema is generated and filled.

Those errors were, in my case:

To Reproduce

  1. Make sure you have at least one tuple with a NULL value in identifier column in either or both maintenance_event and file tables.
  2. Export qgep data to xtf using qgepqwat2ili export tool
  3. Wait for an error message in QGIS (yellow banner at the top of the map), and click to the "Show log" button to read the log
  4. In the log, you have the following error:: Error: illegal value null for Bezeichnung

Expected behavior The qgepqwat2ili tool should fail and create an error to the user sooner, as it is the case with other attributes and tables having a non-null constraint in the .ili model.

Screenshots / data

This is the error from the log:

image

Desktop (please complete the following information):

Additional context

sjib commented 1 year ago

See this discussion https://github.com/QGEP/qgepqwat2ili/issues/64 We could create earlier fails if we do not convert bezeichnung=null_to_emptystr(row.identifier),

That's a usability question to discuss when to raise errors in the export process. I understand the wish to create those early as export can take quite long. On the other hand the error message is quite cryptic and the export crashes when null_to_emptystr is not set.

sjib commented 1 year ago

This SQL allows to create a function to list how many identifiers are null in each table. It then can be run with SELECT qgep_od.count_identifier_null_elements();

create_vsa_dss_2015_2_d.count_identifier_null_qgep_od.zip

sjib commented 1 year ago

Scheduled for technical meeting in March 2023 to clarify usability

sjib commented 1 year ago

Conclusion at technical meeting in March 2023:

sjib commented 1 year ago
sjib commented 1 year ago

20230412_identifier_not_null_integrity_check