mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-13 17:32:53 +00:00
MINOR: Suppress Pydantic Warnings (#20851)
This commit is contained in:
parent
04c327189b
commit
654529ab7a
@ -106,7 +106,7 @@ class BaseModel(PydanticBaseModel):
|
|||||||
exclude_defaults: bool = False,
|
exclude_defaults: bool = False,
|
||||||
exclude_none: bool = True,
|
exclude_none: bool = True,
|
||||||
round_trip: bool = False,
|
round_trip: bool = False,
|
||||||
warnings: Union[bool, Literal["none", "warn", "error"]] = True,
|
warnings: Union[bool, Literal["none", "warn", "error"]] = "none",
|
||||||
fallback: Optional[Callable[[Any], Any]] = None,
|
fallback: Optional[Callable[[Any], Any]] = None,
|
||||||
serialize_as_any: bool = False,
|
serialize_as_any: bool = False,
|
||||||
) -> str:
|
) -> str:
|
||||||
@ -150,12 +150,17 @@ class BaseModel(PydanticBaseModel):
|
|||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
mask_secrets: bool = False,
|
mask_secrets: bool = False,
|
||||||
|
warnings: Union[bool, Literal["none", "warn", "error"]] = "none",
|
||||||
**kwargs,
|
**kwargs,
|
||||||
) -> Dict[str, Any]:
|
) -> Dict[str, Any]:
|
||||||
if mask_secrets:
|
if mask_secrets:
|
||||||
context = kwargs.pop("context", None) or {}
|
context = kwargs.pop("context", None) or {}
|
||||||
context["mask_secrets"] = True
|
context["mask_secrets"] = True
|
||||||
kwargs["context"] = context
|
kwargs["context"] = context
|
||||||
|
|
||||||
|
if "warnings" not in kwargs:
|
||||||
|
kwargs["warnings"] = warnings
|
||||||
|
|
||||||
return super().model_dump(**kwargs)
|
return super().model_dump(**kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user