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

SDK - Made ComponentSpec.implementation field optional #1188

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sdk/python/kfp/components/_dsl_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def create_container_op_from_task(task_spec: TaskSpec):
argument_values = task_spec.arguments
component_spec = task_spec.component_ref._component_spec

if hasattr(component_spec.implementation, 'graph'):
raise TypeError('Cannot convert graph component to ContainerOp')
if not hasattr(component_spec.implementation, 'container'):
Ark-kun marked this conversation as resolved.
Show resolved Hide resolved
raise TypeError('Only container component tasks can be converted to ContainerOp')

inputs_dict = {input_spec.name: input_spec for input_spec in component_spec.inputs or []}
container_spec = component_spec.implementation.container
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/kfp/components/_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,13 @@ class ComponentSpec(ModelBase):
'''Component specification. Describes the metadata (name, description, source), the interface (inputs and outputs) and the implementation of the component.'''
def __init__(
self,
implementation: ImplementationType,
name: Optional[str] = None, #? Move to metadata?
description: Optional[str] = None, #? Move to metadata?
source: Optional[SourceSpec] = None, #? Move to metadata?
metadata: Optional[MetadataSpec] = None,
inputs: Optional[List[InputSpec]] = None,
outputs: Optional[List[OutputSpec]] = None,
implementation: Optional[ImplementationType] = None,
version: Optional[str] = 'google.com/cloud/pipelines/component/v1',
#tags: Optional[Set[str]] = None,
):
Expand Down