Skip to content

get_df UserWarning for PostgresHook #52142

Closed

Description

@cultcom

Apache Airflow Provider(s)

postgres

Versions of Apache Airflow Providers

apache-airflow-providers-postgres==6.2.0

Apache Airflow version

3.0.2

Operating System

Mint 21.3

Deployment

Virtualenv installation

Deployment details

No response

What happened

from airflow.providers.postgres.hooks.postgres import PostgresHook
hook = PostgresHook(postgres_conn_id="pg_default")
hook.get_df("select * from test limit 20")
[2025-06-24T10:46:46.435+0200] {base.py:65} INFO - Connection Retrieved 'pg_default'
/home/user/airflowtest/venv/lib/python3.10/site-packages/airflow/providers/common/sql/hooks/sql.py:482
UserWarning: pandas only supports SQLAlchemy connectable (engine/
connection) or database string URI or sqlite3 DBAPI2 connection. Other DBAPI2 objects are not tested. Please consider using SQLAlchemy.
Out[43]:

What you think should happen instead

The provider should implement the use of sqlalchemy for get_df type=pandas.

How to reproduce

See description above. Simple call the get_df() in ipython.

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. added
    kind:bug
    needs-triage
    on Jun 24, 2025
  2. boring-cyborg commented on Jun 24, 2025

    @boring-cyborg

    Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.

  3. eladkal commented on Jun 24, 2025

    @eladkal
    Contributor

    cc @guan404ming
    leftovers of in #49334 ?

  4. guan404ming commented on Jun 24, 2025

    @guan404ming
    Member

    I think this is not related. But I could help take a look about this.

  5. added and removed
    needs-triage
    on Jun 24, 2025
  6. daesung9511 commented on Jun 24, 2025

    @daesung9511
    Contributor

    Hi! I’m new to the Airflow community and would like to work on this issue.
    Is it okay if I take it?

  7. guan404ming commented on Jun 24, 2025

    @guan404ming
    Member

    Sure, go for it and feel free to ask any questions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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