I am using PostgresHook in an Airflow operator.
pg_hook = PostgresHook(postgres_conn_id='postgres_default')
insert_activities_sql = "INSERT INTO activities (---) VALUES (---) RETURNING id "
activity_results = pg_hook.get_first(insert_activities_sql,parameters=insert_activities_params)
This does return the Id but the record is not committed into the activities table. I have tried running get_records and get_first and neither commit.
.run commits but does not return the results id.
Is this the correct way to insert a record and then return the id?