Open bh2smith opened 2 weeks ago
With the latest version it produces a different kind of ugly-ass error!
Traceback (most recent call last):
File "/home/az/workspace/dune-sync/src/main.py", line 67, in <module>
asyncio.run(main())
File "/home/az/.pyenv/versions/3.12.7/lib/python3.12/asyncio/runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/home/az/.pyenv/versions/3.12.7/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/az/.pyenv/versions/3.12.7/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/home/az/workspace/dune-sync/src/main.py", line 58, in main
config = RuntimeConfig.load_from_yaml(args.config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/az/workspace/dune-sync/src/config.py", line 194, in load_from_yaml
for db_ref in data.get("data_sources", []):
^^^^^^^^
AttributeError: 'list' object has no attribute 'get'
Ignore last comment, I foolishly copied and pasted the entire example into the config.yaml
, instead of just taking it as a job config.
Anyway the issue is addressed in #85 Running the program with this config:
data_sources:
- name: Dune
type: dune
key: ${DUNE_API_KEY}
- name: PG
type: postgres
key: ${DB_URL}
jobs:
- name: Sync Postgres to Another Postgres Table
source:
ref: PG1
query_string: "SELECT * FROM existing_table"
destination:
ref: PG2
table_name: pg_sync_test_table
if_exists: append
now crashes properly and informatively:
Fatal: no datasource with `name` = "PG1" defined in config
I'd keep this issue open for other instances of ugly tracebacks instead of friendly error messages that we're bound to encounter later on.
This job
Produces this ugly-ass error: