mirror of
https://github.com/Infinidat/infi.clickhouse_orm.git
synced 2024-11-22 00:56:34 +03:00
Get rid of some python warnings
This commit is contained in:
parent
85d0fb66b6
commit
39eea8490f
|
@ -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
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue
Block a user