Skip to content

Commit 10b5197

Browse files
committed
fix(fdc): Safely format variable_type mismatch error using getattr fallback
1 parent 361336b commit 10b5197

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

firebase_admin/dataconnect.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ def _validate_variables_type(
226226
raise ValueError("variables must be a collections.abc.Mapping or a dataclass")
227227
if variable_type is not None:
228228
if not isinstance(variables, variable_type):
229-
raise ValueError(f"variables must be of type {variable_type.__name__}")
229+
type_name = getattr(variable_type, '__name__', str(variable_type))
230+
raise ValueError(f"variables must be of type {type_name}")
230231

231232
def _validate_impersonation_options(self, impersonate: Any) -> None:
232233
"""Validates impersonation dictionary options."""

0 commit comments

Comments
 (0)