-
Notifications
You must be signed in to change notification settings - Fork 719
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
TFX pipeline test (Testing Frameworks) #1986
Conversation
tfx/orchestration/pipeline.py
Outdated
def set_executor(self, component_id: Text, executor_factory: Type[FakeComponentExecutorFactory]) -> None: | ||
for component in self._components: | ||
if component_id is component.id: | ||
self.mock_executor_spec[component_id] = executor_factory() |
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.
How about assigning executor_spec directly here? For example,
component.executor_spec = some_executor_spec
Then we might not need to add a new argument for mock executors in other APIs.
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.
+1.
This will work.
component.executor_spec = ExecutorClassSpec(executor_class)
tfx/orchestration/pipeline.py
Outdated
@@ -189,3 +200,23 @@ def components(self, components: List[base_node.BaseNode]): | |||
# has all its dependencies visited. | |||
if len(self._components) < len(deduped_components): | |||
raise RuntimeError('There is a cycle in the pipeline') | |||
|
|||
def set_executor(self, component_id: Text, executor_factory: Type[FakeComponentExecutorFactory]) -> None: |
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 that it would be generally better to pass a Factory instance as an argument, rather than a type. If executor_factory is either FakeComponentExecutorFactory instance or a real executor class type, it would be very helpful. For example, we might be able to use a custom made executor class for one component and use mocks for other components.
It means that we might want the type of executor_factory
is FakeComponentExecutorFactory
OR Type[BaseExecutor]
.
But IIUC, what we really use is executor_spec (For example, FakeExecutorClassSpec
), So I'd like to suggest change argument to ExecutorSpec, then we might be able to assign it directly to the component.
This reverts commit 15b4fd9.
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.
LGTM.
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.
A few nit comments. Please take a look.
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.
Thanks!!
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.
Comments from Zhitao:
There is also some comments about missing intentions although they might have been discussed in either design doc or original PR. Feel free to resolve those.
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.
Thank you so much!
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.
Thanks for the progress!
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.
Thanks!
PiperOrigin-RevId: 319939150
PiperOrigin-RevId: 321081977
PiperOrigin-RevId: 319701322
PiperOrigin-RevId: 319701322
No description provided.