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

Convert reportable resources if necessary #3296

Merged
merged 2 commits into from
Jan 21, 2025
Merged
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
20 changes: 20 additions & 0 deletions src/zenml/config/server_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,26 @@ def _validate_config(cls, data: Dict[str, Any]) -> Dict[str, Any]:

return data

@field_validator("reportable_resources", mode="before")
@classmethod
def _convert_reportable_resources(cls, value: Any) -> Any:
"""Convert reportable resources value if necessary.

This was previously set via an environment variable as a JSON-formatted
string. In case this still exists somewhere, this method converts the
JSON string to a list.

Args:
value: The reportable resources values.

Returns:
The potentially converted value.
"""
if isinstance(value, str):
value = json.loads(value)

return value

@property
def deployment_id(self) -> UUID:
"""Get the ZenML server deployment ID.
Expand Down
Loading