Skip to content

Commit f2fb534

Browse files
authored
chore: fix deprecations and bump dependencies (#219)
1 parent f09b7af commit f2fb534

31 files changed

+200
-181
lines changed

.pre-commit-config.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
repos:
22
- repo: https://github.com/ambv/black
3-
rev: stable
3+
rev: 19.10b0
44
hooks:
55
- id: black
66
language_version: python3
77

8+
- repo: https://github.com/asottile/seed-isort-config
9+
rev: v2.1.1
10+
hooks:
11+
- id: seed-isort-config
12+
813
- repo: https://github.com/pre-commit/pre-commit-hooks
9-
rev: v2.2.3
14+
rev: v3.0.1
1015
hooks:
1116
- id: trailing-whitespace
1217
- id: end-of-file-fixer
@@ -17,6 +22,6 @@ repos:
1722
- id: debug-statements
1823

1924
- repo: https://gitlab.com/pycqa/flake8
20-
rev: 3.7.1
25+
rev: 3.8.2
2126
hooks:
2227
- id: flake8

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ matrix:
33
include:
44
- env: TOXENV=black
55
- env: TOXENV=flake8
6-
- env: TOXENV=py35
7-
python: 3.5
6+
- env: TOXENV=isort
87
- env: TOXENV=py36
98
python: 3.6
109
- env: TOXENV=py37

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
# All configuration values have a default; values that are commented out
1313
# serve to show the default.
1414

15-
import sys
1615
import os
16+
import sys
1717

1818
# If extensions (or modules to document with autodoc) are in another directory,
1919
# add these directories to sys.path here. If the directory is relative to the

pydruid/async_client.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
17-
from __future__ import division
18-
from __future__ import absolute_import
19-
2016
import json
17+
2118
from pydruid.client import BaseDruidClient
2219

2320
try:

pydruid/client.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,12 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
from __future__ import division
17-
from __future__ import absolute_import
18-
1916
import json
2017
import re
21-
22-
from six.moves import urllib
23-
24-
from pydruid.query import QueryBuilder
18+
import urllib
2519
from base64 import b64encode
2620

21+
from pydruid.query import QueryBuilder
2722

2823
# extract error from the <PRE> tag inside the HTML response
2924
HTML_ERROR = re.compile("<pre>\\s*(.*?)\\s*</pre>", re.IGNORECASE)

pydruid/console.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
1-
from __future__ import unicode_literals
2-
31
import os
42
import re
53
import sys
4+
from urllib import parse
65

7-
from prompt_toolkit import prompt, AbortAction
8-
from prompt_toolkit.history import FileHistory
6+
from prompt_toolkit import AbortAction, prompt
97
from prompt_toolkit.contrib.completers import WordCompleter
8+
from prompt_toolkit.history import FileHistory
109
from pygments.lexers import SqlLexer
1110
from pygments.style import Style
12-
from pygments.token import Token
1311
from pygments.styles.default import DefaultStyle
14-
from six.moves.urllib import parse
12+
from pygments.token import Token
1513
from tabulate import tabulate
1614

1715
from pydruid.db.api import connect
1816

19-
2017
keywords = [
2118
"EXPLAIN PLAN FOR",
2219
"WITH",

pydruid/db/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from pydruid.db.api import connect
22
from pydruid.db.exceptions import (
3-
DataError,
43
DatabaseError,
4+
DataError,
55
Error,
66
IntegrityError,
77
InterfaceError,
@@ -12,7 +12,6 @@
1212
Warning,
1313
)
1414

15-
1615
__all__ = [
1716
"connect",
1817
"apilevel",

pydruid/db/api.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
from __future__ import absolute_import
2-
from __future__ import division
3-
from __future__ import print_function
4-
from __future__ import unicode_literals
5-
6-
from collections import namedtuple, OrderedDict
71
import itertools
82
import json
9-
from six import string_types
10-
from six.moves.urllib import parse
3+
from collections import namedtuple, OrderedDict
4+
from urllib import parse
115

126
import requests
137

@@ -110,7 +104,7 @@ def get_type(value):
110104
Note that bool is a subclass of int so order of statements matter.
111105
"""
112106

113-
if isinstance(value, string_types) or value is None:
107+
if isinstance(value, str) or value is None:
114108
return Type.STRING
115109
elif isinstance(value, bool):
116110
return Type.BOOLEAN
@@ -446,7 +440,7 @@ def escape(value):
446440

447441
if value == "*":
448442
return value
449-
elif isinstance(value, string_types):
443+
elif isinstance(value, str):
450444
return "'{}'".format(value.replace("'", "''"))
451445
elif isinstance(value, bool):
452446
return "TRUE" if value else "FALSE"

pydruid/db/exceptions.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
from __future__ import absolute_import
2-
from __future__ import division
3-
from __future__ import print_function
4-
from __future__ import unicode_literals
5-
6-
71
class Error(Exception):
82
pass
93

pydruid/db/sqlalchemy.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
1-
from __future__ import absolute_import
2-
from __future__ import division
3-
from __future__ import print_function
4-
from __future__ import unicode_literals
5-
1+
from sqlalchemy import types
62
from sqlalchemy.engine import default
73
from sqlalchemy.sql import compiler
8-
from sqlalchemy import types
94

105
import pydruid.db
116
from pydruid.db import exceptions
127

13-
148
RESERVED_SCHEMAS = ["INFORMATION_SCHEMA"]
159

1610

0 commit comments

Comments
 (0)