mirror of
https://github.com/Infinidat/infi.clickhouse_orm.git
synced 2025-08-03 11:40:20 +03:00
Chore: isort
This commit is contained in:
parent
e60350259f
commit
f2eb81371a
|
@ -1,16 +1,15 @@
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
import re
|
|
||||||
import requests
|
|
||||||
from collections import namedtuple
|
|
||||||
from .models import ModelBase
|
|
||||||
from .utils import parse_tsv, import_submodules
|
|
||||||
from math import ceil
|
|
||||||
import datetime
|
import datetime
|
||||||
from string import Template
|
|
||||||
import pytz
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
import re
|
||||||
|
from collections import namedtuple
|
||||||
|
from math import ceil
|
||||||
|
from string import Template
|
||||||
|
|
||||||
|
import pytz
|
||||||
|
import requests
|
||||||
|
|
||||||
|
from .models import ModelBase
|
||||||
|
from .utils import import_submodules, parse_tsv
|
||||||
|
|
||||||
logger = logging.getLogger("clickhouse_orm")
|
logger = logging.getLogger("clickhouse_orm")
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from .utils import comma_join, get_subclass_names
|
from .utils import comma_join, get_subclass_names
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
from calendar import timegm
|
from calendar import timegm
|
||||||
from decimal import Decimal, localcontext
|
from decimal import Decimal, localcontext
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
import pytz
|
|
||||||
from copy import copy, deepcopy
|
from copy import copy, deepcopy
|
||||||
from math import ceil
|
from math import ceil
|
||||||
from .utils import comma_join, string_or_func, arg_to_sql
|
|
||||||
|
|
||||||
|
import pytz
|
||||||
|
|
||||||
|
from .utils import arg_to_sql, comma_join, string_or_func
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
# - check that field names are valid
|
# - check that field names are valid
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
This file contains system readonly models that can be got from the database
|
This file contains system readonly models that can be got from the database
|
||||||
https://clickhouse.tech/docs/en/system_tables/
|
https://clickhouse.tech/docs/en/system_tables/
|
||||||
"""
|
"""
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from .database import Database
|
from .database import Database
|
||||||
from .fields import DateTimeField, StringField, UInt8Field, UInt32Field, UInt64Field
|
from .fields import DateTimeField, StringField, UInt8Field, UInt32Field, UInt64Field
|
||||||
from .models import Model
|
from .models import Model
|
||||||
|
|
|
@ -2,7 +2,7 @@ import codecs
|
||||||
import importlib
|
import importlib
|
||||||
import pkgutil
|
import pkgutil
|
||||||
import re
|
import re
|
||||||
from datetime import date, datetime, tzinfo, timedelta
|
from datetime import date, datetime, timedelta, tzinfo
|
||||||
|
|
||||||
SPECIAL_CHARS = {"\b": "\\b", "\f": "\\f", "\r": "\\r", "\n": "\\n", "\t": "\\t", "\0": "\\0", "\\": "\\\\", "'": "\\'"}
|
SPECIAL_CHARS = {"\b": "\\b", "\f": "\\f", "\r": "\\r", "\n": "\\n", "\t": "\\t", "\0": "\\0", "\\": "\\\\", "'": "\\'"}
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ def arg_to_sql(arg):
|
||||||
Supports functions, model fields, strings, dates, datetimes, timedeltas, booleans,
|
Supports functions, model fields, strings, dates, datetimes, timedeltas, booleans,
|
||||||
None, numbers, timezones, arrays/iterables.
|
None, numbers, timezones, arrays/iterables.
|
||||||
"""
|
"""
|
||||||
from clickhouse_orm import Field, StringField, DateTimeField, F, QuerySet
|
from clickhouse_orm import DateTimeField, F, Field, QuerySet, StringField
|
||||||
|
|
||||||
if isinstance(arg, F):
|
if isinstance(arg, F):
|
||||||
return arg.to_sql()
|
return arg.to_sql()
|
||||||
|
|
|
@ -39,6 +39,9 @@ flake8 = "^3.9.2"
|
||||||
flake8-bugbear = "^21.4.3"
|
flake8-bugbear = "^21.4.3"
|
||||||
pep8-naming = "^0.12.0"
|
pep8-naming = "^0.12.0"
|
||||||
pytest = "^6.2.4"
|
pytest = "^6.2.4"
|
||||||
|
flake8-isort = "^4.0.0"
|
||||||
|
black = "^21.7b0"
|
||||||
|
isort = "^5.9.2"
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry-core>=1.0.0"]
|
requires = ["poetry-core>=1.0.0"]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user