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

[0.228.2] StatementError("(builtins.ValueError) could not convert string to float: 'None'") for centrum_pilot_verbeterd_live #149

Open
leendertvanwolfswinkel opened this issue Dec 5, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@leendertvanwolfswinkel
Copy link

When migrating this spatialite: centrum_pilot_verbeterd_live.zip
, I get an error

Traceback (most recent call last):
  File "C:\Users\leendert.vanwolfswin\Documents\migration_checker\migration_checker.py", line 35, in migrate_spatialite
    schema.validate_schema()
  File "C:\Users\leendert.vanwolfswin\AppData\Roaming\Python\Python311\site-packages\threedi_schema\application\schema.py", line 161, in validate_schema
    raise MigrationMissingError(
threedi_schema.application.errors.MigrationMissingError: This tool requires at least schema version 228. Current version: 173.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\leendert.vanwolfswin\AppData\Roaming\Python\Python311\site-packages\sqlalchemy\engine\base.py", line 1815, in _execute_context
    context = constructor(
              ^^^^^^^^^^^^
  File "C:\Users\leendert.vanwolfswin\AppData\Roaming\Python\Python311\site-packages\sqlalchemy\engine\default.py", line 1474, in _init_compiled
    l_param: List[Any] = [
                         ^
  File "C:\Users\leendert.vanwolfswin\AppData\Roaming\Python\Python311\site-packages\sqlalchemy\engine\default.py", line 1476, in <listcomp>
    flattened_processors[key](compiled_params[key])
  File "lib\\sqlalchemy\\cyextension\\processors.pyx", line 27, in sqlalchemy.cyextension.processors.to_float
ValueError: could not convert string to float: 'None'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\leendert.vanwolfswin\Documents\migration_checker\migration_checker.py", line 40, in migrate_spatialite
    schema.upgrade(backup=False, upgrade_spatialite_version=True)
  File "C:\Users\leendert.vanwolfswin\AppData\Roaming\Python\Python311\site-packages\threedi_schema\application\schema.py", line 144, in upgrade
    self.upgrade_spatialite_version()
  File "C:\Users\leendert.vanwolfswin\AppData\Roaming\Python\Python311\site-packages\threedi_schema\application\schema.py", line 202, in upgrade_spatialite_version
    copy_models(self.db, work_db, self.declared_models)
  File "C:\Users\leendert.vanwolfswin\AppData\Roaming\Python\Python311\site-packages\threedi_schema\infrastructure\spatialite_versions.py", line 72, in copy_models
    copy_model(from_db, to_db, model)
  File "C:\Users\leendert.vanwolfswin\AppData\Roaming\Python\Python311\site-packages\threedi_schema\infrastructure\spatialite_versions.py", line 62, in copy_model
    work_session.bulk_save_objects(objs)
  File "C:\Users\leendert.vanwolfswin\AppData\Roaming\Python\Python311\site-packages\sqlalchemy\orm\session.py", line 4585, in bulk_save_objects
    self._bulk_save_mappings(
  File "C:\Users\leendert.vanwolfswin\AppData\Roaming\Python\Python311\site-packages\sqlalchemy\orm\session.py", line 4762, in _bulk_save_mappings
    with util.safe_reraise():
  File "C:\Users\leendert.vanwolfswin\AppData\Roaming\Python\Python311\site-packages\sqlalchemy\util\langhelpers.py", line 146, in __exit__
    raise exc_value.with_traceback(exc_tb)
  File "C:\Users\leendert.vanwolfswin\AppData\Roaming\Python\Python311\site-packages\sqlalchemy\orm\session.py", line 4751, in _bulk_save_mappings
    bulk_persistence._bulk_insert(
  File "C:\Users\leendert.vanwolfswin\AppData\Roaming\Python\Python311\site-packages\sqlalchemy\orm\bulk_persistence.py", line 222, in _bulk_insert
    result = persistence._emit_insert_statements(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\leendert.vanwolfswin\AppData\Roaming\Python\Python311\site-packages\sqlalchemy\orm\persistence.py", line 1048, in _emit_insert_statements
    result = connection.execute(
             ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\leendert.vanwolfswin\AppData\Roaming\Python\Python311\site-packages\sqlalchemy\engine\base.py", line 1418, in execute
    return meth(
           ^^^^^
  File "C:\Users\leendert.vanwolfswin\AppData\Roaming\Python\Python311\site-packages\sqlalchemy\sql\elements.py", line 515, in _execute_on_connection
    return connection._execute_clauseelement(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\leendert.vanwolfswin\AppData\Roaming\Python\Python311\site-packages\sqlalchemy\engine\base.py", line 1640, in _execute_clauseelement
    ret = self._execute_context(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\leendert.vanwolfswin\AppData\Roaming\Python\Python311\site-packages\sqlalchemy\engine\base.py", line 1821, in _execute_context
    self._handle_dbapi_exception(
  File "C:\Users\leendert.vanwolfswin\AppData\Roaming\Python\Python311\site-packages\sqlalchemy\engine\base.py", line 2355, in _handle_dbapi_exception
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "C:\Users\leendert.vanwolfswin\AppData\Roaming\Python\Python311\site-packages\sqlalchemy\engine\base.py", line 1815, in _execute_context
    context = constructor(
              ^^^^^^^^^^^^
  File "C:\Users\leendert.vanwolfswin\AppData\Roaming\Python\Python311\site-packages\sqlalchemy\engine\default.py", line 1474, in _init_compiled
    l_param: List[Any] = [
                         ^
  File "C:\Users\leendert.vanwolfswin\AppData\Roaming\Python\Python311\site-packages\sqlalchemy\engine\default.py", line 1476, in <listcomp>
    flattened_processors[key](compiled_params[key])
  File "lib\\sqlalchemy\\cyextension\\processors.pyx", line 27, in sqlalchemy.cyextension.processors.to_float
sqlalchemy.exc.StatementError: (builtins.ValueError) could not convert string to float: 'None'
[SQL: INSERT INTO culvert (id, display_name, code, exchange_type, friction_value, friction_type, calculation_point_distance, discharge_coefficient_positive, discharge_coefficient_negative, invert_level_start, invert_level_end, geom, connection_node_id_start, connection_node_id_end, cross_section_shape, cross_section_width, cross_section_height) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, GeomFromEWKT(?), ?, ?, ?, ?, ?)]
[parameters: [{'connection_node_id_start': 1030091, 'cross_section_shape': <CrossSectionShape.CIRCLE: 2>, 'discharge_coefficient_negative': 0.8, 'cross_section_widt ... (349 characters truncated) ... ': 1020091, 'display_name': 'SBGOOT*399078', 'calculation_point_distance': 10.0, 'invert_level_end': -2.72, 'code': '399078', 'friction_value': 0.011}, {'connection_node_id_start': 1030128, 'cross_section_shape': <CrossSectionShape.CIRCLE: 2>, 'discharge_coefficient_negative': 0.8, 'cross_section_widt ... (345 characters truncated) ... d': 1020128, 'display_name': 'SBGOOT*399106', 'calculation_point_distance': 10.0, 'invert_level_end': -2.4, 'code': '399106', 'friction_value': 0.011}, {'connection_node_id_start': 1020186, 'cross_section_shape': <CrossSectionShape.CIRCLE: 2>, 'discharge_coefficient_negative': 0.8, 'cross_section_widt ... (380 characters truncated) ... nd': 111229, 'display_name': 'SBGOOT*399190', 'calculation_point_distance': 10.0, 'invert_level_end': 1.92, 'code': '399190', 'friction_value': 0.011}, {'connection_node_id_start': 1020187, 'cross_section_shape': <CrossSectionShape.CIRCLE: 2>, 'discharge_coefficient_negative': 0.8, 'cross_section_widt ... (347 characters truncated) ... d': 1030187, 'display_name': 'SBGOOT*399191', 'calculation_point_distance': 10.0, 'invert_level_end': 3.34, 'code': '399191', 'friction_value': 0.011}, {'connection_node_id_start': 1020238, 'cross_section_shape': <CrossSectionShape.CIRCLE: 2>, 'discharge_coefficient_negative': 0.8, 'cross_section_widt ... (349 characters truncated) ... ': 1030238, 'display_name': 'SBGOOT*399081', 'calculation_point_distance': 10.0, 'invert_level_end': -2.62, 'code': '399081', 'friction_value': 0.011}, {'connection_node_id_start': 1030254, 'cross_section_shape': <CrossSectionShape.CIRCLE: 2>, 'discharge_coefficient_negative': 0.8, 'cross_section_widt ... (349 characters truncated) ... ': 1020254, 'display_name': 'SBGOOT*399083', 'calculation_point_distance': 10.0, 'invert_level_end': -2.54, 'code': '399083', 'friction_value': 0.011}, {'connection_node_id_start': 1030331, 'cross_section_shape': <CrossSectionShape.CIRCLE: 2>, 'discharge_coefficient_negative': 0.8, 'cross_section_widt ... (349 characters truncated) ... ': 1020331, 'display_name': 'SBGOOT*399121', 'calculation_point_distance': 10.0, 'invert_level_end': -2.69, 'code': '399121', 'friction_value': 0.011}, {'connection_node_id_start': 1030332, 'cross_section_shape': <CrossSectionShape.CIRCLE: 2>, 'discharge_coefficient_negative': 0.8, 'cross_section_widt ... (344 characters truncated) ... d': 1020332, 'display_name': 'SBGOOT*399122', 'calculation_point_distance': 10.0, 'invert_level_end': -2.4, 'code': '399122', 'friction_value': 0.011}]]
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