Closed ue71603 closed 2 months ago
I think I understand the error. It happens when creating the SQL statement, I wonder why I am not seeing it. Can your replace {type}
with {type.__name__}
?
Doesn't work for flixbus either. Same problem. I guess it is rather small.
(venv) PS C:\Users\ue71603\MG_Daten\github\reference\gtfs-netex-test> python epip_db_to_xml.py C:/Users/ue71603/MG_Daten/conversion/flixbus/netex-import.duckdb C:/Users/ue71603/MG_Daten/conversion/flixbus/netex-import-epip.duckdb C:
/Users/ue71603/MG_Daten/conversion/flixbus/netex.xml.gz
Traceback (most recent call last):
File "C:\Users\ue71603\MG_Daten\github\reference\gtfs-netex-test\epip_db_to_xml.py", line 243, in <module>
export_epip_network_offer(args.original, args.target, args.output)
File "C:\Users\ue71603\MG_Daten\github\reference\gtfs-netex-test\epip_db_to_xml.py", line 119, in export_epip_network_offer
organisation_or_transport_organisation = load_local(con_orig, Authority) + load_local(con_orig, Operator)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ue71603\MG_Daten\github\reference\gtfs-netex-test\dbaccess.py", line 32, in load_local
cur.execute(f"SELECT object FROM {type};")
duckdb.duckdb.InvalidInputException: Invalid Input Error: Python Object "Authority" of type "type" found on line "C:\Users\ue71603\MG_Daten\github\reference\gtfs-netex-test\epip_db_to_xml.py:119" not suitable for replacement scans.
Make sure that "Authority" is either a pandas.DataFrame, duckdb.DuckDBPyRelation, pyarrow Table, Dataset, RecordBatchReader, Scanner, or NumPy ndarrays with supported format
(venv) PS C:\Users\ue71603\MG_Daten\github\reference\gtfs-netex-test> del C:/Users/ue71603/MG_Daten/conversion/flixbus/*.duckdb
When I did your change the error was:
(venv) PS C:\Users\ue71603\MG_Daten\github\reference\gtfs-netex-test> python epip_db_to_xml.py C:/Users/ue71603/MG_Daten/conversion/flixbus/netex-import.duckdb C:/Users/ue71603/MG_Daten/conversion/flixbus/netex-import-epip.duckdb C:
/Users/ue71603/MG_Daten/conversion/flixbus/netex.xml.gz
Traceback (most recent call last):
File "C:\Users\ue71603\MG_Daten\github\reference\gtfs-netex-test\epip_db_to_xml.py", line 243, in
It seems to be a string...
I am testing it on my laptop now. Upgrading DuckDB already solved one issue. pip install duckdb --upgrade --pre
(unrelated to your report)
I can reproduce your issue.
My error message is much more clear:
Traceback (most recent call last):
File "/mnt/storage/home/skinkie/Sources/references/gtfs-netex-test/epip_db_to_xml.py", line 243, in <module>
export_epip_network_offer(args.original, args.target, args.output)
File "/mnt/storage/home/skinkie/Sources/references/gtfs-netex-test/epip_db_to_xml.py", line 119, in export_epip_network_offer
organisation_or_transport_organisation = load_local(con_orig, Authority) + load_local(con_orig, Operator)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/storage/home/skinkie/Sources/references/gtfs-netex-test/dbaccess.py", line 32, in load_local
cur.execute(f"SELECT object FROM {type};")
duckdb.duckdb.CatalogException: Catalog Error: Table with name Authority does not exist!
Did you mean "Operator"?
@ue71603 please pull, and try again.
worked.... validated in XMLSpy.
doing Flixbus now.
sequence of commands:
error in:
I use exactly the code that I checked out of your repository.