diff --git a/providers/google/src/airflow/providers/google/cloud/hooks/vertex_ai/ray.py b/providers/google/src/airflow/providers/google/cloud/hooks/vertex_ai/ray.py index 76d94299d4967..de722ed595926 100644 --- a/providers/google/src/airflow/providers/google/cloud/hooks/vertex_ai/ray.py +++ b/providers/google/src/airflow/providers/google/cloud/hooks/vertex_ai/ray.py @@ -52,7 +52,7 @@ def __encode_value(value: Any) -> Any: return [__encode_value(nested_value) for nested_value in value] if not isinstance(value, dict) and isinstance(value, MutableMapping): return {key: __encode_value(nested_value) for key, nested_value in dict(value).items()} - if dataclasses.is_dataclass(value): + if dataclasses.is_dataclass(value) and not isinstance(value, type): return dataclasses.asdict(value) return value