-
Notifications
You must be signed in to change notification settings - Fork 301
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
Map over notebook task #1650
Map over notebook task #1650
Changes from all commits
0470d09
29f40e9
7aaa9c3
022ade9
53ec8b8
26237aa
6291806
022d366
d221d1f
4ded410
a44193f
fad7075
ab0375a
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 |
---|---|---|
|
@@ -133,6 +133,7 @@ def __init__( | |
task_config: T = None, | ||
inputs: typing.Optional[typing.Dict[str, typing.Type]] = None, | ||
outputs: typing.Optional[typing.Dict[str, typing.Type]] = None, | ||
output_notebooks: typing.Optional[bool] = True, | ||
**kwargs, | ||
): | ||
# Each instance of NotebookTask instantiates an underlying task with a dummy function that will only be used | ||
|
@@ -165,13 +166,16 @@ def __init__( | |
if not os.path.exists(self._notebook_path): | ||
raise ValueError(f"Illegal notebook path passed in {self._notebook_path}") | ||
|
||
if outputs: | ||
if output_notebooks: | ||
if outputs is None: | ||
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. can do |
||
outputs = {} | ||
outputs.update( | ||
{ | ||
self._IMPLICIT_OP_NOTEBOOK: self._IMPLICIT_OP_NOTEBOOK_TYPE, | ||
self._IMPLICIT_RENDERED_NOTEBOOK: self._IMPLICIT_RENDERED_NOTEBOOK_TYPE, | ||
} | ||
) | ||
|
||
super().__init__( | ||
name, | ||
task_config, | ||
|
@@ -287,6 +291,8 @@ def execute(self, **kwargs) -> Any: | |
else: | ||
raise TypeError(f"Expected output {k} of type {type_v} not found in the notebook outputs") | ||
|
||
if len(output_list) == 1: | ||
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. what happens if we don't do this? 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. There will be a mismatch between the output type and the downstream task's input type. |
||
return output_list[0] | ||
return tuple(output_list) | ||
|
||
def post_execute(self, user_params: ExecutionParameters, rval: Any) -> Any: | ||
|
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.
should this be
actual_task.instantiated_in
? what happens if there are two of the same notebook tasks, named the same, with the same interface, but in two different .py files? will there be confusion?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.
used lhs instead