Skip to content

Error in SQLAlchemy #27

@bertyah

Description

@bertyah

I'm getting this error trying to run a select query. Unsure of what the issue is because it seems like it's coming from SQLalchemy URL instead of the pack itself.

st2 run sql.query connection="postgres" query="select * from employees where employee_id like 'bertyah'"

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions