Skip to content

dbapi_hook get_records doesn't accept list. #9957

@JCoder01

Description

@JCoder01

Apache Airflow version:1.10.10

Kubernetes version (if you are using kubernetes) (use kubectl version):

Environment:

  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:

What happened:

passing a list to dbapi_hook.get_records fails
TypeError: argument 1 must be a string or unicode object: got list instead

What you expected to happen:

return list of query results.

How to reproduce it:

from airflow.hooks.postgres_hook import PostgresHook
PostgresHook().get_records(['select * from dag_run limit 1', 'select * from dag_run limit 1'])

Anything else we need to know:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions