Skip to content
Open
Changes from all commits
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
9 changes: 6 additions & 3 deletions google/cloud/aiplatform/utils/pipeline_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ def __init__(
self._failure_policy = failure_policy
self._default_runtime = default_runtime

# Cache the version comparison to avoid repeated parsing
self._is_legacy_schema = packaging.version.parse(
self._schema_version
) <= packaging.version.parse("2.0.0")

@classmethod
def from_job_spec_json(
cls,
Expand Down Expand Up @@ -243,9 +248,7 @@ def _get_vertex_value(
"pipeline job input definitions.".format(name)
)

if packaging.version.parse(self._schema_version) <= packaging.version.parse(
"2.0.0"
):
if self._is_legacy_schema:
result = {}
if self._parameter_types[name] == "INT":
result["intValue"] = value
Expand Down