diff --git a/perxis/collections/helpers.py b/perxis/collections/helpers.py index 0a0d66f8846908f2726628c974b5c84e6635174b..d4215d6a8dbc1e7b16b054aceffb05b26bdce8c0 100644 --- a/perxis/collections/helpers.py +++ b/perxis/collections/helpers.py @@ -47,8 +47,13 @@ def init_collections( with open(f"{schemes_dir}/{collection_id}.json", "r") as file: collection_schema = file.read() + props = collections_settings_mapping.get(collection_id) or CollectionProps() + + if not isinstance(props, CollectionProps): + raise TypeError("collections_settings_mapping value must be an instance of CollectionProps") + kwargs = { - **collections_settings_mapping.get(collection_id).to_dict(), + **props.to_dict(), "id": collection_id, "name": collection_name, "schema": collection_schema,