Skip to content

Commit

Permalink
Merge pull request apache#243 from mistercrunch/sensor_sticky_conn
Browse files Browse the repository at this point in the history
Insure keeping the same connection through the sensor's lifecycle
  • Loading branch information
mistercrunch committed Jun 5, 2015
2 parents c301ff9 + ee7d326 commit c8891f2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions airflow/operators/sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,9 @@ def poke(self):
logging.info(
'Poking for table {self.schema}.{self.table}, '
'partition {self.partition}'.format(**locals()))
self.hook = hooks.HiveMetastoreHook(
metastore_conn_id=self.metastore_conn_id)
if not hasattr(self, 'hook'):
self.hook = hooks.HiveMetastoreHook(
metastore_conn_id=self.metastore_conn_id)
return self.hook.check_for_partition(
self.schema, self.table, self.partition)

Expand Down

0 comments on commit c8891f2

Please sign in to comment.