diff --git a/flytekit/core/launch_plan.py b/flytekit/core/launch_plan.py index 9cd0cc6fb7..a930af93ad 100644 --- a/flytekit/core/launch_plan.py +++ b/flytekit/core/launch_plan.py @@ -176,6 +176,7 @@ def create( name=name, workflow=workflow, parameters=wf_signature_parameters, + python_interface=temp_interface, fixed_inputs=fixed_lm, schedule=schedule, notifications=notifications, @@ -334,6 +335,7 @@ def __init__( workflow: _annotated_workflow.WorkflowBase, parameters: _interface_models.ParameterMap, fixed_inputs: _literal_models.LiteralMap, + python_interface: Optional[Interface] = None, schedule: Optional[_schedule_model.Schedule] = None, notifications: Optional[List[_common_models.Notification]] = None, labels: Optional[_common_models.Labels] = None, @@ -349,6 +351,7 @@ def __init__( # Ensure fixed inputs are not in parameter map parameters = {k: v for k, v in parameters.parameters.items() if k not in fixed_inputs.literals} self._parameters = _interface_models.ParameterMap(parameters=parameters) + self._python_interface = python_interface self._fixed_inputs = fixed_inputs # See create() for additional information self._saved_inputs: Dict[str, Any] = {} @@ -362,13 +365,13 @@ def __init__( self._security_context = security_context self._trigger = trigger self._overwrite_cache = overwrite_cache - FlyteEntities.entities.append(self) def clone_with( self, name: str, parameters: Optional[_interface_models.ParameterMap] = None, + python_interface: Optional[Interface] = None, fixed_inputs: Optional[_literal_models.LiteralMap] = None, schedule: Optional[_schedule_model.Schedule] = None, notifications: Optional[List[_common_models.Notification]] = None, @@ -384,6 +387,7 @@ def clone_with( name=name, workflow=self.workflow, parameters=parameters or self.parameters, + python_interface=python_interface or self.python_interface, fixed_inputs=fixed_inputs or self.fixed_inputs, schedule=schedule or self.schedule, notifications=notifications or self.notifications, @@ -402,7 +406,7 @@ def overwrite_cache(self) -> Optional[bool]: @property def python_interface(self) -> Interface: - return self.workflow.python_interface + return self._python_interface if self._python_interface else self.workflow.python_interface @property def interface(self) -> _interface_models.TypedInterface: