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

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

Closed
skinkie opened this issue Jan 29, 2025 · 4 comments
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@skinkie
Copy link
Owner

skinkie commented Jan 29, 2025

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'
@skinkie skinkie added the bug Something isn't working label Jan 29, 2025
@skinkie skinkie added this to the 1.0 milestone Jan 29, 2025
@skinkie skinkie self-assigned this Jan 29, 2025
@ue71603
Copy link
Collaborator

ue71603 commented Jan 29, 2025

sorry. didn't see that. As not assigned to me.

@skinkie
Copy link
Owner Author

skinkie commented Jan 29, 2025

It still resolves into the question: the PostalAddress has an id-attribute in their dataset, lacks version, is never referenced. Our embedding code triggers on the fact it has an id. Because of the lack of any enforcement of id's being required or not (that part was not merged NeTEx-CEN/NeTEx#471 ) need to do something better. I think the approach of selecting the class by being interesting or not would make sense. I am testing now if that could work (also with respect to the DuckDB-UDF).

@ue71603
Copy link
Collaborator

ue71603 commented Jan 29, 2025

Good idea. i did things like that in other places already.

skinkie added a commit that referenced this issue Jan 29, 2025
@skinkie
Copy link
Owner Author

skinkie commented Jan 29, 2025

Solved.

@skinkie skinkie closed this as completed Jan 29, 2025
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