Skip to content

Problem with fr_aube (and other French NETEX files) #84

@ue71603

Description

@ue71603

In
./tool_scripts/script_regression_v1.1.txt log1.log fr_aube

there is a problem here
recursive_attributes.py

def embedding_obj_iter(
    serializer: Serializer, deserialized: Tid, interesting_classes: Optional[set[type[Tid]]], ignore: Optional[set[type[Tid]]]
) -> Generator[tuple[Optional[bytes], Tid, list[int]], None, None]:
    assert deserialized.id is not None, "deserialised.id must not be none"

    for obj, path in recursive_attributes(deserialized, []):
        if hasattr(obj, "id") and obj.id is not None:
            if (ignore is None or obj.__class__ not in ignore) and (interesting_classes is None or obj.__class__ in interesting_classes):
                yield serializer.encode_key(obj.id, obj.version if hasattr(obj, "version") else None, obj.__class__, include_clazz=True), obj, path

The problem is that __class__ is somewhat not valid and then the byte serializer gets a problem.
I don't know why this happens.


D:\development\github\badger\.venv\Scripts\python.exe -X pycache_prefix=C:\Users\Gm\AppData\Local\JetBrains\PyCharmCE2025.1\cpython-cache "C:/Program Files/JetBrains/PyCharm Community Edition 2025.1.1/plugins/python-ce/helpers/pydev/pydevd.py" --multiprocess --qt-support=auto --client 127.0.0.1 --port 51644 --file D:\development\github\badger\tools\script_runner.py ./tool_scripts/script_regression_v1.1.txt log1.log fr_aube --begin_step=4 
Connected to pydev debugger (build 251.25410.122)
2026-01-13 21:39:40,138 - script_runner - INFO - fr_aube - step: 4: conv.epip_db_to_db d:/aux_testing_processing/fr_aube/03-import.mdbx d:/aux_testing_processing/fr_aube/04-netex-database.mdbx
the arguments ['d:/aux_testing_processing/fr_aube/03-import.mdbx', 'd:/aux_testing_processing/fr_aube/04-netex-database.mdbx']
<class 'domain.netex.model.simple_point_version_structure.SimplePointVersionStructure'>
2026-01-13 21:46:00,147 - script_runner - ERROR - <class 'domain.netex.model.simple_point_version_structure.SimplePointVersionStructure'>
Traceback (most recent call last):
  File "D:\development\github\badger\tools\script_runner.py", line 436, in main
    result = load_and_run(script_name, script_args)
  File "D:\development\github\badger\tools\script_runner.py", line 116, in load_and_run
    result = main_function(*args1)
  File "D:\development\github\badger\conv\epip_db_to_db.py", line 310, in main
    epip_db_to_db(source_path, Path(target))
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\development\github\badger\conv\epip_db_to_db.py", line 152, in epip_db_to_db
    source_db.insert_any_object_on_queue(txn_write1, all_psas())
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\development\github\badger\storage\mdbx\core\implementation.py", line 242, in insert_any_object_on_queue
    for obj in objects:
               ^^^^^^^
  File "D:\development\github\badger\conv\epip_db_to_db.py", line 138, in all_psas
    embedding[1].id: getRef(obj, StopPlaceRef) for key, obj, embedding in resolve_embeddings_iterable(source_db, txn_write1, StopPlace)
                                                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\development\github\badger\storage\mdbx\core\references.py", line 46, in resolve_embeddings_iterable
    for candidate in embedding_obj_iter(storage.serializer, obj, interesting_classes, ignore):
                     ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\development\github\badger\domain\netex\services\recursive_attributes.py", line 186, in embedding_obj_iter
    yield serializer.encode_key(obj.id, obj.version if hasattr(obj, "version") else None, obj.__class__, include_clazz=True), obj, path
          ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\development\github\badger\storage\mdbx\serialization\byteserializer.py", line 53, in encode_key
    encoded_bytes.extend(self.class_idx[clazz])
                         ~~~~~~~~~~~~~~^^^^^^^
KeyError: <class 'domain.netex.model.simple_point_version_structure.SimplePointVersionStructure'>
2026-01-13 21:46:00,158 - script_runner - INFO - Execution time: 380.0 seconds for fr_aube - step: 4: conv.epip_db_to_db d:/aux_testing_processing/fr_aube/03-import.mdbx d:/aux_testing_processing/fr_aube/04-netex-database.mdbx

2026-01-13 21:46:00,158 - script_runner - ERROR - Script conv.epip_db_to_db returned an error. Terminating the block of scripts: fr_aube

Process finished with exit code 1

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions