Skip to content

Commit

Permalink
Fix issue with to_pod and deploy time fields
Browse files Browse the repository at this point in the history
  • Loading branch information
romain-intel committed Dec 4, 2024
1 parent b2fa766 commit 32b6e99
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions metaflow/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,12 +436,17 @@ def to_pod(value):
Value to convert to POD format. The value can be a string, number, list,
dictionary, or a nested structure of these types.
"""
# Prevent circular imports
from metaflow.parameters import DeployTimeField

if isinstance(value, (str, int, float)):
return value
if isinstance(value, dict):
return {to_pod(k): to_pod(v) for k, v in value.items()}
if isinstance(value, (list, set, tuple)):
return [to_pod(v) for v in value]
if isinstance(value, DeployTimeField):
return value.print_representation
return str(value)


Expand Down

0 comments on commit 32b6e99

Please sign in to comment.