Commit 1b878bd9 by Lukáš Lalinský

Fix flake8 errors on Python 3.x

parent ddc4dc06
Pipeline #18658 passed with stages
in 10 minutes 19 seconds
......@@ -97,7 +97,6 @@ working Phoenix database and set the ``PHOENIXDB_TEST_DB_URL`` environment varia
Known issues
------------
- In general, the library has not been battle-tested yet. You might encounter almost any problem. Use with care.
- You can only use the library in autocommit mode. The native Java Phoenix library also implements batched upserts, which can be committed at once, but this is not exposed over the remote server.
(`CALCITE-767 <https://issues.apache.org/jira/browse/CALCITE-767>`_)
- TIME and DATE columns in Phoenix are stored as full timestamps with a millisecond accuracy,
......
......@@ -9,4 +9,4 @@ with phoenixdb.connect('http://localhost:8765/', autocommit=True) as connection:
cursor.executemany("UPSERT INTO test VALUES (?, ?)", [[1, 'hello'], [2, 'world']])
cursor.execute("SELECT * FROM test ORDER BY id")
for row in cursor:
print row
print(row)
......@@ -131,6 +131,11 @@ BOOLEAN = ColumnType(['BOOLEAN'])
# XXX ARRAY
if sys.version_info[0] < 3:
_long = long # noqa: F821
else:
_long = int
JAVA_CLASSES = {
'bool_value': [
('java.lang.Boolean', common_pb2.BOOLEAN, None, None),
......@@ -143,7 +148,7 @@ JAVA_CLASSES = {
'number_value': [
('java.lang.Integer', common_pb2.INTEGER, None, int),
('java.lang.Short', common_pb2.SHORT, None, int),
('java.lang.Long', common_pb2.LONG, None, long if sys.version_info[0] < 3 else int),
('java.lang.Long', common_pb2.LONG, None, _long),
('java.lang.Byte', common_pb2.BYTE, None, int),
('java.sql.Time', common_pb2.JAVA_SQL_TIME, time_to_java_sql_time, time_from_java_sql_time),
('java.sql.Date', common_pb2.JAVA_SQL_DATE, date_to_java_sql_date, date_from_java_sql_date),
......
......@@ -14,6 +14,6 @@ upload-dir = doc/build/html
[flake8]
max-line-length = 140
exclude =
e,env,venv,doc,build,dist,.tox,.idea,
e,e3,env,venv,doc,build,dist,.tox,.idea,
./phoenixdb/tests/dbapi20.py,
./phoenixdb/calcite/*_pb2.py
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment