Skip to content
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

'tuple' object has no attribute 'get when running sql.query #31

Open
porlock opened this issue Jul 18, 2024 · 2 comments
Open

'tuple' object has no attribute 'get when running sql.query #31

porlock opened this issue Jul 18, 2024 · 2 comments

Comments

@porlock
Copy link

porlock commented Jul 18, 2024

i'm using python 3.8 and sqlalchemy==2.0.31 when trying to run [sql.query] action i got following error:

"stderr": "Traceback (most recent call last):\n File \"/opt/stackstorm/st2/lib/python3.8/site-packages/python_runner/python_action_wrapper.py\", line 395, in <module>\n obj.run()\n File \"/opt/stackstorm/st2/lib/python3.8/site-packages/python_runner/python_action_wrapper.py\", line 214, in run\n output = action.run(**self._parameters)\n File \"/opt/stackstorm/packs/sql/actions/generic_query.py\", line 22, in run\n with self.db_connection(kwargs_dict) as conn:\n File \"/usr/lib/python3.8/contextlib.py\", line 113, in __enter__\n return next(self.gen)\n File \"/opt/stackstorm/packs/sql/actions/lib/base_action.py\", line 129, in db_connection\n self.engine = sqlalchemy.create_engine(database_connection_string, echo=False)\n File \"<string>\", line 2, in create_engine\n File \"/opt/stackstorm/virtualenvs/sql/lib/python3.8/site-packages/sqlalchemy/util/deprecations.py\", line 281, in warned\n return fn(*args, **kwargs) # type: ignore[no-any-return]\n File \"/opt/stackstorm/virtualenvs/sql/lib/python3.8/site-packages/sqlalchemy/engine/create.py\", line 548, in create_engine\n u, plugins, kwargs = u._instantiate_plugins(kwargs)\n File \"/opt/stackstorm/virtualenvs/sql/lib/python3.8/site-packages/sqlalchemy/engine/url.py\", line 726, in _instantiate_plugins\n plugin_names = util.to_list(self.query.get(\"plugin\", ()))\nAttributeError: 'tuple' object has no attribute 'get'\n",

@daBONDi
Copy link

daBONDi commented Dec 3, 2024

have the same problem, with a mssql+pymssql connection.

Do you figured it out?

@daBONDi
Copy link

daBONDi commented Dec 4, 2024

I think i found it.

sqlalchmey make breaking changes on 2.x

requirements.txt have no version definition for sqlalchmey, so it installs 2.x

changed requirements.txt to 1.4.54 fixed the issue it seems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants