Skip to content

BUG: 'Engine' object has no attribute 'cursor' #60124

Open
@Jagadish250803

Description

@Jagadish250803

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

@task
    def push_into_postgres(df , table_name):
        
        user = 'postgres'  # Ensure this is correct
        password = 'postgres'  # Ensure this is correct
        host = 'astro-airflow_c0c605-postgres-1'
        port = 5432
        database_name = 'postgres'

        db_uri = f'postgresql://{user}:{password}@{host}:{port}/{database_name}'
        engine = create_engine(db_uri)

        try:
            df.to_sql(table_name, con=engine, if_exists='append', index=False)
            print(f"Data successfully pushed to {table_name}")

Issue Description

i had all the import properly with all the versions

Expected Behavior

what is going wrong
the dataframe which is getting used its proper i had printed it

Installed Versions

Replace this line with the output of pd.show_versions()

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIO SQLto_sql, read_sql, read_sql_queryNeeds InfoClarification about behavior needed to assess issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions