Skip to content

Commit

Permalink
use basemodel for structures
Browse files Browse the repository at this point in the history
  • Loading branch information
connor-mccarthy committed Apr 29, 2022
1 parent 1e87f09 commit ec9d0b5
Show file tree
Hide file tree
Showing 4 changed files with 400 additions and 388 deletions.
2 changes: 1 addition & 1 deletion sdk/python/kfp/components/base_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def __call__(self, *args, **kwargs) -> pipeline_task.PipelineTask:
missing_arguments = [
input_name for input_name, input_spec in (
self.component_spec.inputs or {}).items()
if input_name not in task_inputs and not input_spec.optional and
if input_name not in task_inputs and not input_spec._optional and
not type_utils.is_task_final_status_type(input_spec.type)
]
if missing_arguments:
Expand Down
7 changes: 4 additions & 3 deletions sdk/python/kfp/components/pipeline_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
# limitations under the License.
"""Pipeline task class and operations."""

import re
import copy
import re
from typing import Any, List, Mapping, Optional, Union

from kfp.components import constants
from kfp.components import placeholders
from kfp.components import pipeline_channel
from kfp.components import placeholders
from kfp.components import structures
from kfp.components.types import type_utils

Expand Down Expand Up @@ -116,6 +116,7 @@ def __init__(
self.container_spec = None

if component_spec.implementation.container is not None:

self.container_spec = self._resolve_command_line_and_arguments(
component_spec=component_spec,
args=args,
Expand Down Expand Up @@ -266,7 +267,7 @@ def expand_command_part(arg) -> Union[str, List[str], None]:
return input_path
else:
input_spec = inputs_dict[input_name]
if input_spec.optional:
if input_spec._optional:
return None
else:
raise ValueError(
Expand Down
Loading

0 comments on commit ec9d0b5

Please sign in to comment.