Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export Selection of reaches and wastewater structures fails #463

Open
ponceta opened this issue Oct 16, 2024 · 1 comment
Open

Export Selection of reaches and wastewater structures fails #463

ponceta opened this issue Oct 16, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@ponceta
Copy link
Member

ponceta commented Oct 16, 2024

Describe the bug
Export Selection of reaches and wastewater structures fails :

image

sqlalchemy.exc.ArgumentError: ON clause, typically a SQL expression or ORM relationship attribute expected, got . 
Traceback (most recent call last):
  File "C:\Users/pulpoar/AppData/Roaming/QGIS/QGIS3\profiles\pulpoar/python/plugins\teksi_wastewater\teksi_wastewater_plugin.py", line 605, in actionExportClicked
    self.interlisImporterExporter.action_export()
  File "C:\Users/pulpoar/AppData/Roaming/QGIS/QGIS3\profiles\pulpoar/python/plugins\teksi_wastewater\interlis\gui\interlis_importer_exporter_gui.py", line 149, in action_export
    raise exception
  File "C:\Users/pulpoar/AppData/Roaming/QGIS/QGIS3\profiles\pulpoar/python/plugins\teksi_wastewater\interlis\gui\interlis_importer_exporter_gui.py", line 119, in action_export
    self.interlis_importer_exporter.interlis_export(
  File "C:\Users/pulpoar/AppData/Roaming/QGIS/QGIS3\profiles\pulpoar/python/plugins\teksi_wastewater\interlis\interlis_importer_exporter.py", line 198, in interlis_export
    self._export_to_intermediate_schema(
  File "C:\Users/pulpoar/AppData/Roaming/QGIS/QGIS3\profiles\pulpoar/python/plugins\teksi_wastewater\interlis\interlis_importer_exporter.py", line 366, in _export_to_intermediate_schema
    twwInterlisExporter.tww_export()
  File "C:\Users/pulpoar/AppData/Roaming/QGIS/QGIS3\profiles\pulpoar/python/plugins\teksi_wastewater\interlis\interlis_model_mapping\interlis_exporter_to_intermediate_schema.py", line 88, in tww_export
    raise exception
  File "C:\Users/pulpoar/AppData/Roaming/QGIS/QGIS3\profiles\pulpoar/python/plugins\teksi_wastewater\interlis\interlis_model_mapping\interlis_exporter_to_intermediate_schema.py", line 83, in tww_export
    self._export()
  File "C:\Users/pulpoar/AppData/Roaming/QGIS/QGIS3\profiles\pulpoar/python/plugins\teksi_wastewater\interlis\interlis_model_mapping\interlis_exporter_to_intermediate_schema.py", line 98, in _export
    self._export_sia405_abwasser()
  File "C:\Users/pulpoar/AppData/Roaming/QGIS/QGIS3\profiles\pulpoar/python/plugins\teksi_wastewater\interlis\interlis_model_mapping\interlis_exporter_to_intermediate_schema.py", line 212, in _export_sia405_abwasser
    self._export_dryweather_downspout()
  File "C:\Users/pulpoar/AppData/Roaming/QGIS/QGIS3\profiles\pulpoar/python/plugins\teksi_wastewater\interlis\interlis_model_mapping\interlis_exporter_to_intermediate_schema.py", line 826, in _export_dryweather_downspout
    query = query.join(
            ^^^^^^^^^^^
  File "", line 2, in join
  File "C:\OSGeo4W\apps\Python312\Lib\site-packages\sqlalchemy\sql\base.py", line 280, in _generative
    x = fn(self, *args, **kw)
        ^^^^^^^^^^^^^^^^^^^^^
  File "", line 2, in join
  File "C:\OSGeo4W\apps\Python312\Lib\site-packages\sqlalchemy\orm\base.py", line 304, in generate
    fn(self, *args, **kw)
  File "C:\OSGeo4W\apps\Python312\Lib\site-packages\sqlalchemy\orm\query.py", line 2429, in join
    onclause_element = coercions.expect(
                       ^^^^^^^^^^^^^^^^^
  File "C:\OSGeo4W\apps\Python312\Lib\site-packages\sqlalchemy\sql\coercions.py", line 396, in expect
    resolved = impl._literal_coercion(
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\OSGeo4W\apps\Python312\Lib\site-packages\sqlalchemy\sql\coercions.py", line 899, in _literal_coercion
    self._raise_for_expected(element)
  File "C:\OSGeo4W\apps\Python312\Lib\site-packages\sqlalchemy\sql\coercions.py", line 518, in _raise_for_expected
    raise exc.ArgumentError(msg, code=code) from err
sqlalchemy.exc.ArgumentError: ON clause, typically a SQL expression or ORM relationship attribute expected, got .

To Reproduce
Export Selection to DSS

  1. Select some connected reaches and wastewater structures
  2. Click on export
  3. Click on limit to selection
  4. See error

Expected behavior
A selection can be easily exported

Screenshots / data
If applicable, add screenshots or data to help explain your problem.

Desktop (please complete the following information):

  • QGEP plugin version
  • QGEP datamodel version
  • QGEP project file version
  • QGIS Version
  • OS

Additional context
Add any other context about the problem here.

@sjib sjib self-assigned this Oct 18, 2024
@sjib sjib added the bug Something isn't working label Oct 18, 2024
@sjib
Copy link
Contributor

sjib commented Oct 18, 2024

Wrong selection criteria _export_dryweather_downspout

@sjib sjib added this to the TEKSI Wastewater 2024.0 milestone Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants