diff --git a/src/infi/clickhouse_orm/fields.py b/src/infi/clickhouse_orm/fields.py index 601b8ad..0ee90e9 100644 --- a/src/infi/clickhouse_orm/fields.py +++ b/src/infi/clickhouse_orm/fields.py @@ -429,7 +429,7 @@ class BaseEnumField(Field): import re from enum import Enum members = {} - for match in re.finditer("'([\w ]+)' = (-?\d+)", db_type): + for match in re.finditer(r"'([\w ]+)' = (-?\d+)", db_type): members[match.group(1)] = int(match.group(2)) enum_cls = Enum('AdHocEnum', members) field_class = Enum8Field if db_type.startswith('Enum8') else Enum16Field diff --git a/tests/test_querysets.py b/tests/test_querysets.py index 6409ffa..bca8076 100644 --- a/tests/test_querysets.py +++ b/tests/test_querysets.py @@ -484,11 +484,11 @@ class AggregateTestCase(TestCaseWithData): # Test with limit and offset, also mixing LIMIT with LIMIT BY qs = Person.objects_in(self.database).filter(height__gt=1.67).order_by('height', 'first_name') limited_qs = qs.limit_by((0, 3), 'height') - self.assertEquals([p.first_name for p in limited_qs[:3]], ['Amanda', 'Buffy', 'Dora']) + self.assertEqual([p.first_name for p in limited_qs[:3]], ['Amanda', 'Buffy', 'Dora']) limited_qs = qs.limit_by((3, 3), 'height') - self.assertEquals([p.first_name for p in limited_qs[:3]], ['Elton', 'Josiah', 'Macaulay']) + self.assertEqual([p.first_name for p in limited_qs[:3]], ['Elton', 'Josiah', 'Macaulay']) limited_qs = qs.limit_by((6, 3), 'height') - self.assertEquals([p.first_name for p in limited_qs[:3]], ['Norman', 'Octavius', 'Oliver']) + self.assertEqual([p.first_name for p in limited_qs[:3]], ['Norman', 'Octavius', 'Oliver']) Color = Enum('Color', u'red blue green yellow brown white black')