diff --git a/src/zenml/config/server_config.py b/src/zenml/config/server_config.py index b5d33750148..efc602530c4 100644 --- a/src/zenml/config/server_config.py +++ b/src/zenml/config/server_config.py @@ -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.