-
Notifications
You must be signed in to change notification settings - Fork 132
Standalone activity prototype #1138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
7666cdc
c725d71
b5d2d2f
896fc87
32ff692
c78fee7
e6f6ca2
51f7da8
7781c2a
ecbaed9
4a4a731
32f5abb
d28ae5b
741603f
1e75e38
e069732
e37c625
269d532
4d355d1
976532d
92faa7f
ea402d9
af9f80a
48d5ddc
d71fe31
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -588,6 +588,20 @@ def must_from_callable(fn: Callable) -> _Definition: | |
f"Activity {fn_name} missing attributes, was it decorated with @activity.defn?" | ||
) | ||
|
||
@classmethod | ||
def get_name_and_result_type( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we're extracting this common logic out of |
||
cls, name_or_run_fn: Union[str, Callable[..., Any]] | ||
) -> Tuple[str, Optional[Type]]: | ||
if isinstance(name_or_run_fn, str): | ||
return name_or_run_fn, None | ||
elif callable(name_or_run_fn): | ||
defn = cls.must_from_callable(name_or_run_fn) | ||
if not defn.name: | ||
raise ValueError(f"Activity {name_or_run_fn} definition has no name") | ||
return defn.name, defn.ret_type | ||
else: | ||
raise TypeError("Activity must be a string or callable") | ||
|
||
@staticmethod | ||
def _apply_to_callable( | ||
fn: Callable, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
from .message_pb2 import ActivityOptions | ||
from .message_pb2 import ( | ||
ActivityExecutionInfo, | ||
ActivityListInfo, | ||
ActivityOptions, | ||
OnConflictOptions, | ||
) | ||
|
||
__all__ = [ | ||
"ActivityExecutionInfo", | ||
"ActivityListInfo", | ||
"ActivityOptions", | ||
"OnConflictOptions", | ||
] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should go ahead and put here the expected changes to activity runtime. Specifically I assume all
workflow_
-prefixed fields ofInfo
will become optional. I would also recommend either a "kind" enumerate for activities, or add anis_standalone
akin tois_local
so users can know it's not the traditional activity.