-
Notifications
You must be signed in to change notification settings - Fork 40
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
Unable to use transform
on SQLite table
#159
Comments
Parts of the base SQLDecorator class did not take into account SQLite support. I refactored the necessary parts to solve this error message, and also the one which came after this issue was solved: [2022-03-03 22:23:01,827] {debug_executor.py:87} ERROR - Failed to execute task: local variable 'results' referenced before assignment.
Traceback (most recent call last):
File "/home/tati/.virtualenvs/astro-main/lib/python3.9/site-packages/airflow/executors/debug_executor.py", line 79, in _run_task
ti._run_raw_task(job_id=ti.job_id, **params)
File "/home/tati/.virtualenvs/astro-main/lib/python3.9/site-packages/airflow/utils/session.py", line 70, in wrapper
return func(*args, session=session, **kwargs)
File "/home/tati/.virtualenvs/astro-main/lib/python3.9/site-packages/airflow/models/taskinstance.py", line 1334, in _run_raw_task
self._execute_task_with_callbacks(context)
File "/home/tati/.virtualenvs/astro-main/lib/python3.9/site-packages/airflow/models/taskinstance.py", line 1460, in _execute_task_with_callbacks
result = self._execute_task(context, self.task)
File "/home/tati/.virtualenvs/astro-main/lib/python3.9/site-packages/airflow/models/taskinstance.py", line 1516, in _execute_task
result = execute_callable(context=context)
File "/home/tati/Code/astro/src/astro/sql/operators/sql_decorator.py", line 131, in execute
if not self.raw_sql:
File "/home/tati/Code/astro/src/astro/sql/operators/sql_decorator.py", line 238, in _set_schema_if_needed
self._run_sql_string(schema_statement, {})
File "/home/tati/Code/astro/src/astro/sql/operators/sql_decorator.py", line 278, in _run_sql_string
return results
UnboundLocalError: local variable 'results' referenced before assignment |
After solving hook-related issues, there was an issue with the SQL clause to create a table based on a select statement. The currently used one did not work with SQLite:
|
This issue was solved by removing the parenthesis from the SQL statement if we run it using SQLite only:
|
Ready for review: #157 |
Version:
astro 0.6.0
How to reproduce the problem (originally found in branch
readme
as part of the PR #157 ):Error message:
The text was updated successfully, but these errors were encountered: