observatoire-mobilite / odmkraken

The **kraken** is the orchestration layer responsible for gathering and postprocessing ODM's mobility data
MIT License
0 stars 0 forks source link

Import not working #2

Closed gilgeorges closed 1 year ago

gilgeorges commented 1 year ago

Import ICTS data fails with following error:

dagster._core.errors.DagsterExecutionStepExecutionError: Error occurred while executing op "adjust_dates":
  File "/opt/conda/lib/python3.10/site-packages/dagster/_core/execution/plan/execute_plan.py", line 224, in dagster_event_sequence_for_step
    for step_event in check.generator(step_events):
  File "/opt/conda/lib/python3.10/site-packages/dagster/_core/execution/plan/execute_step.py", line 357, in core_dagster_event_sequence_for_step
    for user_event in check.generator(
  File "/opt/conda/lib/python3.10/site-packages/dagster/_core/execution/plan/execute_step.py", line 69, in _step_output_error_checked_user_event_sequence
    for user_event in user_event_sequence:
  File "/opt/conda/lib/python3.10/site-packages/dagster/_core/execution/plan/compute.py", line 174, in execute_core_compute
    for step_output in _yield_compute_results(step_context, inputs, compute_fn):
  File "/opt/conda/lib/python3.10/site-packages/dagster/_core/execution/plan/compute.py", line 142, in _yield_compute_results
    for event in iterate_with_context(
  File "/opt/conda/lib/python3.10/site-packages/dagster/_utils/__init__.py", line 428, in iterate_with_context
    with context_fn():
  File "/opt/conda/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/opt/conda/lib/python3.10/site-packages/dagster/_core/execution/plan/utils.py", line 77, in solid_execution_error_boundary
    raise error_cls(
The above exception was caused by the following exception:
psycopg2.errors.UndefinedTable: relation "vehdata.raw_data" does not exist
CONTEXT:  SQL statement "alter table "vehdata".raw_data add column zeit timestamp"
PL/pgSQL function vehdata.adjust_format(character varying,integer) line 3 at SQL statement

  File "/opt/conda/lib/python3.10/site-packages/dagster/_core/execution/plan/utils.py", line 47, in solid_execution_error_boundary
    yield
  File "/opt/conda/lib/python3.10/site-packages/dagster/_utils/__init__.py", line 430, in iterate_with_context
    next_output = next(iterator)
  File "/opt/conda/lib/python3.10/site-packages/dagster/_core/execution/plan/compute_generator.py", line 73, in _coerce_solid_compute_fn_to_iterator
    result = fn(context, **kwargs) if context_arg_provided else fn(**kwargs)
  File "/app/odmkraken/busspeeds/extract.py", line 75, in adjust_dates
    context.resources.edmo_vehdata.adjust_date(nd.date)
  File "/app/odmkraken/resources/edmo/busdata.py", line 78, in adjust_date
    self.store.run('select * from vehdata.adjust_format(%s)', date)
  File "/app/odmkraken/resources/postgres.py", line 57, in run
    cur.execute(sql, args)
gilgeorges commented 1 year ago

Diagnosis: this seems to be due to cursors not committing correctly

gilgeorges commented 1 year ago

Solved by #3