From bd2bf4a0444c47aff76676fa8fdaea3ba031b55f Mon Sep 17 00:00:00 2001 From: Mayur Singal <39544459+ulixius9@users.noreply.github.com> Date: Wed, 26 Jun 2024 20:31:02 +0530 Subject: [PATCH] MINOR: Include default values in custom pydantic model (#16795) --- ingestion/src/metadata/ingestion/models/custom_pydantic.py | 2 +- .../integration/ometa/test_ometa_custom_properties_api.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ingestion/src/metadata/ingestion/models/custom_pydantic.py b/ingestion/src/metadata/ingestion/models/custom_pydantic.py index 134c8734ec5..55d9f651864 100644 --- a/ingestion/src/metadata/ingestion/models/custom_pydantic.py +++ b/ingestion/src/metadata/ingestion/models/custom_pydantic.py @@ -46,7 +46,7 @@ class BaseModel(PydanticBaseModel): context: Optional[Dict[str, Any]] = None, by_alias: bool = False, exclude_unset: bool = True, - exclude_defaults: bool = True, + exclude_defaults: bool = False, exclude_none: bool = True, round_trip: bool = False, warnings: Union[bool, Literal["none", "warn", "error"]] = True, diff --git a/ingestion/tests/integration/ometa/test_ometa_custom_properties_api.py b/ingestion/tests/integration/ometa/test_ometa_custom_properties_api.py index 9b7ab3aa411..f08a7bbafa8 100644 --- a/ingestion/tests/integration/ometa/test_ometa_custom_properties_api.py +++ b/ingestion/tests/integration/ometa/test_ometa_custom_properties_api.py @@ -92,7 +92,9 @@ EXPECTED_CUSTOM_PROPERTIES = [ "name": "Rating", "description": "Rating of a table", "propertyType": {"name": "enum"}, - "customPropertyConfig": {"config": {"values": ["Good", "Average", "Bad"]}}, + "customPropertyConfig": { + "config": {"values": ["Good", "Average", "Bad"], "multiSelect": False}, + }, }, { "name": "TableSize",