diff --git a/src/zenml/constants.py b/src/zenml/constants.py index 183b1acce1..a2fde9aaba 100644 --- a/src/zenml/constants.py +++ b/src/zenml/constants.py @@ -173,6 +173,7 @@ def handle_int_env_var(var: str, default: int = 0) -> int: ENV_ZENML_PIPELINE_RUN_API_TOKEN_EXPIRATION = ( "ZENML_PIPELINE_API_TOKEN_EXPIRATION" ) +ENV_ZENML_ALLOW_NON_ASCII_MATERIALIZERS_DUMPS = "ZENML_ALLOW_NON_ASCII_MATERIALIZERS_DUMPS" # ZenML Server environment variables ENV_ZENML_SERVER_PREFIX = "ZENML_SERVER_" diff --git a/src/zenml/utils/yaml_utils.py b/src/zenml/utils/yaml_utils.py index 6f84832526..ccad8513db 100644 --- a/src/zenml/utils/yaml_utils.py +++ b/src/zenml/utils/yaml_utils.py @@ -20,9 +20,16 @@ import yaml +from zenml.constants import ( + ENV_ZENML_ALLOW_NON_ASCII_MATERIALIZERS_DUMPS, + handle_bool_env_var, +) from zenml.io import fileio from zenml.utils import io_utils +ZENML_ALLOW_NON_ASCII_MATERIALIZERS_DUMPS = handle_bool_env_var( + ENV_ZENML_ALLOW_NON_ASCII_MATERIALIZERS_DUMPS, False +) def write_yaml( file_path: str, @@ -142,6 +149,7 @@ def write_json( file_path, json.dumps( contents, + ensure_ascii=not ZENML_ALLOW_NON_ASCII_MATERIALIZERS_DUMPS, cls=encoder, ), )