From d77bfa8dbd5a369c9ae7f0efb07c110629d0b7a6 Mon Sep 17 00:00:00 2001 From: Gerda Shank Date: Thu, 19 Dec 2024 13:22:44 -0500 Subject: [PATCH] Add mashumaro no_copy_collection() to dialect --- dbt_common/dataclass_schema.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dbt_common/dataclass_schema.py b/dbt_common/dataclass_schema.py index 0aad4d5..1c5b515 100644 --- a/dbt_common/dataclass_schema.py +++ b/dbt_common/dataclass_schema.py @@ -15,11 +15,15 @@ from mashumaro.jsonschema import build_json_schema # following includes DataClassDictMixin -from mashumaro.mixins.msgpack import DataClassMessagePackMixin +from mashumaro.mixins.msgpack import DataClassMessagePackMixin, MessagePackDialect import functools +class FixedMessagePackDialect(MessagePackDialect): + no_copy_collections = () + + class ValidationError(jsonschema.ValidationError): pass @@ -49,6 +53,7 @@ class dbtMashConfig(MashBaseConfig): } serialize_by_alias = True lazy_compilation = True + dialect = FixedMessagePackDialect # This class pulls in DataClassDictMixin from Mashumaro. The 'to_dict'