From 4cc46db2098b54e1cbcf1b2f183b34afcc92adce Mon Sep 17 00:00:00 2001 From: Tyler Kennedy Date: Mon, 3 Jun 2024 08:52:23 -0400 Subject: [PATCH] Allow tuples as a valid type for `meta.key` Most modern linters (like `ruff`) will complain about `meta.key` being a list, as it's a mutable class variable. Allowing a tuple here appears to work fine and removes the need to override linter rules for `meta.key`. --- psqlextra/backend/schema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/psqlextra/backend/schema.py b/psqlextra/backend/schema.py index 28e9211a..31a23414 100644 --- a/psqlextra/backend/schema.py +++ b/psqlextra/backend/schema.py @@ -1045,7 +1045,7 @@ def _partitioning_properties_for_model(model: Type[Model]): % (model.__name__, meta.method) ) - if not isinstance(meta.key, list): + if not isinstance(meta.key, (list, tuple)): raise ImproperlyConfigured( ( "Model '%s' is not properly configured to be partitioned."