diff --git a/flytekit/core/python_function_task.py b/flytekit/core/python_function_task.py index a198dabf36..ec52b61b87 100644 --- a/flytekit/core/python_function_task.py +++ b/flytekit/core/python_function_task.py @@ -157,8 +157,10 @@ def __init__( self._execution_mode = execution_mode self._node_dependency_hints = node_dependency_hints if self._node_dependency_hints is not None and self._execution_mode != self.ExecutionBehavior.DYNAMIC: - raise ValueError("node_dependency_hints should only be used on dynamic tasks. On static tasks and " - "workflows its redundant because flyte can find the node dependencies automatically") + raise ValueError( + "node_dependency_hints should only be used on dynamic tasks. On static tasks and " + "workflows its redundant because flyte can find the node dependencies automatically" + ) self._wf = None # For dynamic tasks @property diff --git a/tests/flytekit/unit/core/test_python_function_task.py b/tests/flytekit/unit/core/test_python_function_task.py index 45efaabf5d..9203b66bb9 100644 --- a/tests/flytekit/unit/core/test_python_function_task.py +++ b/tests/flytekit/unit/core/test_python_function_task.py @@ -6,8 +6,7 @@ from flytekit import task from flytekit.configuration import Image, ImageConfig, SerializationSettings from flytekit.core.pod_template import PodTemplate -from flytekit.core.python_auto_container import \ - get_registerable_container_image +from flytekit.core.python_auto_container import get_registerable_container_image from flytekit.core.python_function_task import PythonFunctionTask from flytekit.core.tracker import isnested, istestfunction from flytekit.image_spec.image_spec import ImageBuildEngine, ImageSpec @@ -220,9 +219,7 @@ def test_node_dependency_hints_are_not_allowed(): def t1(i: str): pass - with pytest.raises( - ValueError, match="node_dependency_hints should only be used on dynamic tasks" - ): + with pytest.raises(ValueError, match="node_dependency_hints should only be used on dynamic tasks"): @task(node_dependency_hints=[t1]) def t2(i: str):