Repository: incubator-airflow Updated Branches: refs/heads/master 08e28ab88 -> 241fd2709
[AIRFLOW-778] Fix completey broken MetastorePartitionSensor MetastorePartitionSensor always throws an exception on initialization due to 72cc8b3006576153aa30d27643807b4ae5dfb593 . This PR reverts the breaking part of this commit. Looks like the tests for this are only run if an explicit flag is set which is how this got past CI. Closes #2005 from aoen/ddavydov/fix_metastore_partition_sensor Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/241fd270 Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/241fd270 Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/241fd270 Branch: refs/heads/master Commit: 241fd2709fa948336018cfa1032bcea2c8b8d1bd Parents: 08e28ab Author: Dan Davydov <[email protected]> Authored: Fri Jan 20 14:28:06 2017 -0800 Committer: Dan Davydov <[email protected]> Committed: Fri Jan 20 14:28:24 2017 -0800 ---------------------------------------------------------------------- airflow/operators/sensors.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/241fd270/airflow/operators/sensors.py ---------------------------------------------------------------------- diff --git a/airflow/operators/sensors.py b/airflow/operators/sensors.py index f5dd148..5fbd21c 100644 --- a/airflow/operators/sensors.py +++ b/airflow/operators/sensors.py @@ -152,7 +152,12 @@ class MetastorePartitionSensor(SqlSensor): self.schema = schema self.first_poke = True self.conn_id = mysql_conn_id - super(MetastorePartitionSensor, self).__init__(*args, **kwargs) + # TODO(aoen): We shouldn't be using SqlSensor here but MetastorePartitionSensor. + # The problem is the way apply_defaults works isn't compatible with inheritance. + # The inheritance model needs to be reworked in order to support overriding args/ + # kwargs with arguments here, then 'conn_id' and 'sql' can be passed into the + # constructor below and apply_defaults will no longer throw an exception. + super(SqlSensor, self).__init__(*args, **kwargs) def poke(self, context): if self.first_poke:
