diff --git a/projects/orquestra-sdk/CHANGELOG.md b/projects/orquestra-sdk/CHANGELOG.md index 24450e693..cf5b07090 100644 --- a/projects/orquestra-sdk/CHANGELOG.md +++ b/projects/orquestra-sdk/CHANGELOG.md @@ -5,6 +5,7 @@ 🚨 *Breaking Changes* * Setting `workspace_id` is now required when submitting workflow to remote clusters +* `TaskDef` `WorkflowDef` and `TaskInvocation` Objects `__init__` functions now do set parameters by default. 🔥 *Features* diff --git a/projects/orquestra-sdk/src/orquestra/sdk/_client/_base/_dsl.py b/projects/orquestra-sdk/src/orquestra/sdk/_client/_base/_dsl.py index 62fc122b1..6649854fe 100644 --- a/projects/orquestra-sdk/src/orquestra/sdk/_client/_base/_dsl.py +++ b/projects/orquestra-sdk/src/orquestra/sdk/_client/_base/_dsl.py @@ -538,15 +538,15 @@ def __init__( self, fn: Callable[..., _TaskReturn], output_metadata: "orquestra.sdk._client._base._dsl.TaskOutputMetadata", # pyright: ignore # NOQA - source_import: Optional[Import] = None, - parameters: Optional[OrderedDict] = None, - dependency_imports: Optional[Tuple[Import, ...]] = None, - resources: Resources = Resources(), - custom_image: Optional[str] = None, - custom_name: Optional[str] = None, - fn_ref: Optional[FunctionRef] = None, - max_retries: Optional[int] = None, - env_vars: Optional[Dict[str, str]] = None, + source_import: Optional[Import], + parameters: Optional[OrderedDict], + dependency_imports: Optional[Tuple[Import, ...]], + resources: Resources, + custom_image: Optional[str], + custom_name: Optional[str], + fn_ref: Optional[FunctionRef], + max_retries: Optional[int], + env_vars: Optional[Dict[str, str]], ): if isinstance(fn, BuiltinFunctionType): raise NotImplementedError("Built-in functions are not supported as Tasks") @@ -670,6 +670,7 @@ def __call__( custom_name=parse_custom_name(self._custom_name, signature), custom_image=self._custom_image, env_vars=self._env_vars, + type="task_invocation", ) ) @@ -731,11 +732,11 @@ def __init__( task: TaskDef[_TaskReturn], args: Tuple[Argument, ...], kwargs: Tuple[Tuple[str, Argument], ...], - type: str = "task_invocation", - resources: Resources = Resources(), - custom_name: Optional[str] = None, - custom_image: Optional[str] = None, - env_vars: Optional[Dict[str, str]] = None, + type: str, + resources: Resources, + custom_name: Optional[str], + custom_image: Optional[str], + env_vars: Optional[Dict[str, str]], ): self.task = task self.args = args @@ -939,6 +940,7 @@ def with_invocation_meta( custom_name=invocation.custom_name, custom_image=new_custom_image, env_vars=new_env_vars, + type=invocation.type, ) return ArtifactFuture( @@ -1296,6 +1298,7 @@ def _inner(fn: Callable): custom_name=custom_name, max_retries=max_retries, env_vars=env_vars, + fn_ref=None, ) return task_def diff --git a/projects/orquestra-sdk/src/orquestra/sdk/_client/_base/_workflow.py b/projects/orquestra-sdk/src/orquestra/sdk/_client/_base/_workflow.py index 46313ad04..69cc8d60e 100644 --- a/projects/orquestra-sdk/src/orquestra/sdk/_client/_base/_workflow.py +++ b/projects/orquestra-sdk/src/orquestra/sdk/_client/_base/_workflow.py @@ -72,11 +72,11 @@ def __init__( fn_ref: FunctionRef, resources: _dsl.Resources, head_node_image: Optional[str], - data_aggregation: Optional[DataAggregation] = None, - workflow_args: Optional[Tuple[Any, ...]] = None, - workflow_kwargs: Optional[Dict[str, Any]] = None, - default_source_import: Optional[Import] = None, - default_dependency_imports: Optional[Iterable[Import]] = None, + data_aggregation: Optional[DataAggregation], + workflow_args: Optional[Tuple[Any, ...]], + workflow_kwargs: Optional[Dict[str, Any]], + default_source_import: Optional[Import], + default_dependency_imports: Optional[Iterable[Import]], ): self._name = name self._fn = workflow_fn