Skip to content
Discussion options

You must be logged in to vote

PostgresHook actually performs the update.

SQLExecuteQueryOperator does not notify you in any way that an update fails. Despite the existence of an autocommit option, it doesn't commit and returns success. I am very much out of my comfort zone to submit a bug report on this because I know so little. So, here it stays.

from  airflow.providers.postgres.hooks.postgres import PostgresHook
###LOTS MORE CODE###
try:
 conn_op = PostgresHook(
 postgres_conn_id='pg_for_me',
 schema='bls',
 autocommit=True
 )
except Exception as e:
 print('cannot get postgresHook')
 raise AirflowException(e)

try:
 conn = conn_op.get_conn()
 cursor = conn.cursor()
except Exception as e:
 print("Could not get cursor…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@Taragolis
Comment options

@prime-minister-of-fun
Comment options

@prime-minister-of-fun
Comment options

@prime-minister-of-fun
Comment options

Answer selected by prime-minister-of-fun
@Taragolis
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants