File tree Expand file tree Collapse file tree 1 file changed +15
-16
lines changed
Expand file tree Collapse file tree 1 file changed +15
-16
lines changed Original file line number Diff line number Diff line change 1616import copy
1717import hashlib
1818import inspect
19- from abc import abstractmethod
2019from collections import defaultdict
2120from typing import (
2221 TYPE_CHECKING ,
2726 List ,
2827 Mapping ,
2928 Optional ,
29+ Protocol ,
3030 Sequence ,
3131 Tuple ,
3232 Type ,
9797F = TypeVar ("F" , bound = Callable [..., Any ])
9898
9999
100- class BaseStep (Generic [F ]):
100+ class _AbstractEntrypoint (Protocol [F ]):
101+ entrypoint : F
102+ """Abstract method for core step logic.
103+
104+ Args:
105+ *args: Positional arguments passed to the step.
106+ **kwargs: Keyword arguments passed to the step.
107+
108+ Returns:
109+ The output of the step.
110+ """
111+
112+
113+ class BaseStep (Generic [F ], _AbstractEntrypoint [F ]):
101114 """Abstract base class for all ZenML steps."""
102115
103116 def __init__ (
@@ -214,20 +227,6 @@ def __init__(
214227
215228 notebook_utils .try_to_save_notebook_cell_code (self .source_object )
216229
217- @abstractmethod
218- def entrypoint (self , * args : Any , ** kwargs : Any ) -> Any :
219- """Abstract method for core step logic.
220-
221- Args:
222- *args: Positional arguments passed to the step.
223- **kwargs: Keyword arguments passed to the step.
224-
225- Returns:
226- The output of the step.
227- """
228-
229- entrypoint : F # type:ignore[no-redef]
230-
231230 @classmethod
232231 def load_from_source (cls , source : Union [Source , str ]) -> "BaseStep[F]" :
233232 """Loads a step from source.
You can’t perform that action at this time.
0 commit comments