Coverage for airflow.hooks.postgres_hook: 78%

# Coverage for airflow.hooks.postgres_hook : 78%

## 9 statements 7 run 2 missing 0 excluded

Hot-keys on this page

r m x p toggle line displays

j k next/prev highlighted chunk

0 (zero) top of page

1 (one) first highlighted chunk

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | import psycopg2 from airflow.hooks.dbapi_hook import DbApiHook class PostgresHook(DbApiHook): ''' Interact with Postgres. ''' conn_name_attr = 'postgres_conn_id' default_conn_name = 'postgres_default' supports_autocommit = True def get_conn(self): conn = self.get_connection(self.postgres_conn_id) return psycopg2.connect( host=conn.host, user=conn.login, password=conn.password, dbname=conn.schema, port=conn.port)