-
Notifications
You must be signed in to change notification settings - Fork 960
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
sample_oracle_loader.py - sqlalchemy.exc.ObjectNotExecutableError #2108
Comments
Thanks for opening your first issue here! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
I am receiving the same issue trying to implement sample_postgres_loader.py
|
It looks like this is related to some changes in SqlAlchemy 2.0. I was able to resolve the issue by pinning the version of SqlAlchemy to a prior version in the requirements.txt file
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This issue has been automatically closed for inactivity. If you still wish to make these changes, please open a new pull request or reopen this one. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Trying to load some data into our newly installed instance of Amundsen using the sample_oracle_loader.py, but running into an exception in the sqlalchemy library. Only thing I've changed in the code is the connection string to our database.
Expected Behavior
Program completes successfully and data is (hopefully) loaded into Amundsen
Current Behavior
Raises an exception on loading_job.launch()
Traceback
File "C:\Users...\venv\lib\site-packages\sqlalchemy\engine\base.py", line 1410, in execute
meth = statement._execute_on_connection
AttributeError: 'str' object has no attribute '_execute_on_connection'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users...\venv\lib\site-packages\databuilder\job\job.py", line 76, in launch
raise e
File "C:\Users...\venv\lib\site-packages\databuilder\job\job.py", line 64, in launch
self._init()
File "C:\Users...\venv\lib\site-packages\databuilder\job\job.py", line 51, in _init
self.task.init(self.conf)
File "C:\Users...\venv\lib\site-packages\databuilder\task\task.py", line 45, in init
self.extractor.init(Scoped.get_scoped_conf(conf, self.extractor.get_scope()))
File "C:\Users...\venv\lib\site-packages\databuilder\extractor\oracle_metadata_extractor.py", line 58, in init
self._alchemy_extractor.init(sql_alch_conf)
File "C:\Users...\venv\lib\site-packages\databuilder\extractor\sql_alchemy_extractor.py", line 40, in init
self._execute_query()
File "C:\Users...\venv\lib\site-packages\databuilder\extractor\sql_alchemy_extractor.py", line 65, in _execute_query
self.results = self.connection.execute(self.extract_sql)
File "C:\Users...\venv\lib\site-packages\sqlalchemy\engine\base.py", line 1412, in execute
raise exc.ObjectNotExecutableError(statement) from err
sqlalchemy.exc.ObjectNotExecutableError: Not an executable object: '\n SELECT\n 'master' as "cluster",\n lower(c.owner) as "schema",\n lower(c.table_name) as "name",\n tc.comments as "description",\n lwer(c.column_name) as "col_name",\n lower(c.data_type) as "col_type",\n cc.comments as "col_description",\n lower(c.column_id) as "col_sort_order"\n FROM\n all_tab_columns c\n LEFT JOIN\n all_tab_comments tc ON c.owner=tc.owner AND c.table_name=tc.table_name\n LEFT JOIN\n all_col_comments cc ON c.owner=cc.owner AND c.table_name=cc.table_name AND c.column_name=cc.column_name\n \nwhere table_schema = 'public'\n\n ORDER BY "cluster", "schema", "name", "col_sort_order"\n '
python-BaseException
Screenshots
I was curious to see if this query would run outside of Python, and it doesn't - However, if you exclude the WHERE clause, it runs fine. Not sure if this is related or not.
Thanks!
The text was updated successfully, but these errors were encountered: