pandas-dev / pandas

Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more
https://pandas.pydata.org
BSD 3-Clause "New" or "Revised" License
43.9k stars 18.03k forks source link

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

Open Jagadish250803 opened 4 weeks ago

Jagadish250803 commented 4 weeks ago

Pandas version checks

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()
rhshadrach commented 4 weeks ago

Can you include the output of pd.show_versions(). What is the output when you do print(type(engine))?