Skip to content

Commit 179f039

Browse files
Merge pull request #69 from pipeline-tools/v0.22.1
v0.22.1
2 parents 1736d49 + b4acaa4 commit 179f039

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

gusty/building.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,10 @@ def _get_operator_parameters(operator, operator_param_cache):
145145
operator_param_cache.update({operator: params})
146146
return params
147147

148-
params = inspect.signature(operator.__init__).parameters.keys()
148+
params = list(inspect.signature(operator.__init__).parameters.keys())
149+
template_fields = list(getattr(operator, "template_fields", []))
150+
if len(template_fields) > 0:
151+
params = list(set(params + template_fields))
149152
operator_param_cache.update({operator: params})
150153
return params
151154

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="gusty",
8-
version="0.22.0",
8+
version="0.22.1",
99
author="Chris Cardillo, Michael Chow, David Robinson",
1010
author_email="cfcardillo23@gmail.com",
1111
description="Making DAG construction easier",

tests/test_custom_operators.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
def test_get_operator_parameters():
66
class ACustomOperator(BaseOperator):
7+
template_fields = ("a_templated_field",)
8+
79
def __init__(self, a, **kwargs):
810
self.a = 1
911

@@ -15,7 +17,7 @@ def execute(self, context):
1517
params = _get_operator_parameters(ACustomOperator, {})
1618

1719
assert "a" in params
18-
assert list(params) == ["self", "a", "kwargs"]
20+
assert sorted(params) == ["a", "a_templated_field", "kwargs", "self"]
1921

2022

2123
def test_get_operator_parameters_attribute():

tests/test_python_tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ def test_py_dummy(dag):
6868

6969
def test_automatic_py(dag, py_task):
7070
task = dag.task_dict["simple_leaf"]
71-
assert type(py_task) == type(task)
71+
assert type(py_task) is type(task)

0 commit comments

Comments
 (0)