Skip to content
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

Merged
merged 59 commits into from
Jul 14, 2020

Conversation

iamsusiep
Copy link
Contributor

No description provided.

@nikelite nikelite requested review from nikelite and jiyongjung0 June 12, 2020 06:44
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()

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.

Copy link
Contributor

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)

@@ -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:

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.

Copy link
Contributor

@nikelite nikelite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link

@jiyongjung0 jiyongjung0 left a 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.

@iamsusiep iamsusiep changed the title TFX pipeline test with dummy executors (Testing Frameworks) TFX pipeline test (Testing Frameworks) Jul 7, 2020
Copy link

@jiyongjung0 jiyongjung0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!!

Copy link

@jiyongjung0 jiyongjung0 left a 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.

Copy link

@jiyongjung0 jiyongjung0 left a 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!

Copy link

@jiyongjung0 jiyongjung0 left a 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!

tfx/experimental/pipeline_testing/base_stub_executor.py Outdated Show resolved Hide resolved
tfx/experimental/pipeline_testing/stub_launcher_test.py Outdated Show resolved Hide resolved
tfx/utils/io_utils.py Outdated Show resolved Hide resolved
Copy link

@jiyongjung0 jiyongjung0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

copybara-service bot pushed a commit that referenced this pull request Jul 14, 2020
PiperOrigin-RevId: 319939150
copybara-service bot pushed a commit that referenced this pull request Jul 14, 2020
PiperOrigin-RevId: 321081977
copybara-service bot pushed a commit that referenced this pull request Jul 14, 2020
PiperOrigin-RevId: 319701322
copybara-service bot pushed a commit that referenced this pull request Jul 14, 2020
PiperOrigin-RevId: 319701322
@copybara-service copybara-service bot merged commit c56625d into tensorflow:master Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants