Skip to content

Embedding allows to add non-interesting classes in the embedding table #234

@skinkie

Description

@skinkie
2025-01-29 01:04:42,325 - script_runner - ERROR - 'PostalAddress_VersionStructure' Traceback (most recent call last):
  File "/mnt/storage/home/skinkie/Sources/references/gtfs-netex-test/epip_db_to_db.py", line 77, in <module>
    main(args.source, args.target)
  File "/mnt/storage/home/skinkie/Sources/references/gtfs-netex-test/epip_db_to_db.py", line 66, in main
    missing_class_update(source_db, target_db)
  File "/mnt/storage/home/skinkie/Sources/references/gtfs-netex-test/netexio/dbaccess.py", line 708, in missing_class_update
    embedded_classes = set(target_db.embedded())
                           ^^^^^^^^^^^^^^^^^^^^
  File "/mnt/storage/home/skinkie/Sources/references/gtfs-netex-test/netexio/database.py", line 62, in embedded
    tables = {self.get_class_by_name(table) for table, in cur.fetchall() if table[0].isupper()} # TODO: Remove other classes from default namespace!
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/storage/home/skinkie/Sources/references/gtfs-netex-test/netexio/database.py", line 62, in <setcomp>
    tables = {self.get_class_by_name(table) for table, in cur.fetchall() if table[0].isupper()} # TODO: Remove other classes from default namespace!
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/storage/home/skinkie/Sources/references/gtfs-netex-test/netexio/database.py", line 66, in get_class_by_name
    return self.serializer.name_object[name]
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
KeyError: 'PostalAddress_VersionStructure'

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions