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 16
16
import copy
17
17
import hashlib
18
18
import inspect
19
- from abc import abstractmethod
20
19
from collections import defaultdict
21
20
from typing import (
22
21
TYPE_CHECKING ,
27
26
List ,
28
27
Mapping ,
29
28
Optional ,
29
+ Protocol ,
30
30
Sequence ,
31
31
Tuple ,
32
32
Type ,
97
97
F = TypeVar ("F" , bound = Callable [..., Any ])
98
98
99
99
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 ]):
101
114
"""Abstract base class for all ZenML steps."""
102
115
103
116
def __init__ (
@@ -214,20 +227,6 @@ def __init__(
214
227
215
228
notebook_utils .try_to_save_notebook_cell_code (self .source_object )
216
229
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
-
231
230
@classmethod
232
231
def load_from_source (cls , source : Union [Source , str ]) -> "BaseStep[F]" :
233
232
"""Loads a step from source.
You can’t perform that action at this time.
0 commit comments