From a6f311b001df682a159df7f30183f0333048844e Mon Sep 17 00:00:00 2001 From: JieguangZhou Date: Thu, 15 Aug 2024 12:01:00 +0800 Subject: [PATCH] Change __dataclass_params to _dataclass_params --- CHANGELOG.md | 1 + plugins/ibis/superduper_ibis/query.py | 2 +- plugins/mongodb/superduper_mongodb/query.py | 2 +- superduper/base/leaf.py | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1af659426..80ce17725 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix verbosity in component info - Change default encoding to sqlvector - Fix some links in documentation +- Change `__dataclass_params__` to `_dataclass_params` ## [0.3.0](https://github.com/superduper-io/superduper/compare/0.3.0...0.2.0]) (2024-Jun-21) diff --git a/plugins/ibis/superduper_ibis/query.py b/plugins/ibis/superduper_ibis/query.py index f4b908f77..0214cf26f 100644 --- a/plugins/ibis/superduper_ibis/query.py +++ b/plugins/ibis/superduper_ibis/query.py @@ -105,7 +105,7 @@ class IbisQuery(Query): } # Use to control the behavior in the class construction method within LeafMeta - __dataclass_params__: t.ClassVar[t.Dict[str, t.Any]] = { + _dataclass_params: t.ClassVar[t.Dict[str, t.Any]] = { "eq": False, "order": False, } diff --git a/plugins/mongodb/superduper_mongodb/query.py b/plugins/mongodb/superduper_mongodb/query.py index cf4773ec9..80f9eab8d 100644 --- a/plugins/mongodb/superduper_mongodb/query.py +++ b/plugins/mongodb/superduper_mongodb/query.py @@ -118,7 +118,7 @@ class MongoQuery(Query): } # Use to control the behavior in the class construction method within LeafMeta - __dataclass_params__: t.ClassVar[t.Dict[str, t.Any]] = { + _dataclass_params: t.ClassVar[t.Dict[str, t.Any]] = { 'eq': False, 'order': False, } diff --git a/superduper/base/leaf.py b/superduper/base/leaf.py index 2c1f751ce..ec74ec725 100644 --- a/superduper/base/leaf.py +++ b/superduper/base/leaf.py @@ -85,7 +85,7 @@ def __new__(mcs, name, bases, namespace): # Determine if any bases are dataclasses and # apply the appropriate dataclass decorator # - dataclass_params = namespace.get('__dataclass_params__', {}) + dataclass_params = namespace.get('_dataclass_params', {}).copy() if bases and any(dc.is_dataclass(b) for b in bases): dataclass_params['kw_only'] = True dataclass_params['repr'] = not name.endswith('Query')