This commit is contained in:
Jing Wang 2017-08-14 00:07:01 -07:00
Родитель 1858fa7753
Коммит 44717f7b5f
6 изменённых файлов: 26 добавлений и 10 удалений

Просмотреть файл

@ -21,5 +21,5 @@ install:
- ./scripts/travis-install.sh
- pip install codecov
# sleep so Presto has time to start up. Otherwise we might get 'No nodes available to run query'
script: sleep 10 && pytest -v
script: sleep 10 && PYTHONHASHSEED=random pytest -v
after_success: codecov

Просмотреть файл

@ -260,8 +260,7 @@ class HiveDialect(default.DefaultDialect):
try:
coltype = _type_map[col_type]
except KeyError:
util.warn("Did not recognize type '%s' of column '%s'" % (
col_type, col_name))
util.warn("Did not recognize type '%s' of column '%s'" % (col_type, col_name))
coltype = types.NullType
result.append({
'name': col_name,

Просмотреть файл

@ -46,6 +46,7 @@ _type_map = {
'varchar': types.String,
'timestamp': types.TIMESTAMP,
'date': types.DATE,
'varbinary': types.VARBINARY,
}

Просмотреть файл

@ -1,19 +1,22 @@
# coding: utf-8
from __future__ import absolute_import
from __future__ import unicode_literals
from builtins import object
import abc
import contextlib
import functools
import unittest
from distutils.version import StrictVersion
from future.utils import with_metaclass
import pytest
import sqlalchemy
from builtins import object
from future.utils import with_metaclass
from sqlalchemy.exc import NoSuchTableError
from sqlalchemy.schema import Index
from sqlalchemy.schema import MetaData
from sqlalchemy.schema import Table
from sqlalchemy.sql import expression
import abc
import contextlib
import functools
import unittest
def with_engine_connection(fn):
@ -75,6 +78,7 @@ class SqlAlchemyTestCase(with_metaclass(abc.ABCMeta, object)):
self.assertEqual(len(dummy.c), 1)
self.assertIsNotNone(dummy.c.a)
@pytest.mark.filterwarnings('default:Omitting:sqlalchemy.exc.SAWarning')
@with_engine_connection
def test_reflect_partitions(self, engine, connection):
"""reflecttable should get the partition column as an index"""

Просмотреть файл

@ -66,7 +66,7 @@ class TestSqlAlchemyPresto(unittest.TestCase, SqlAlchemyTestCase):
self.assertIsInstance(one_row_complex.c.double.type, types.Float)
self.assertIsInstance(one_row_complex.c.string.type, String)
self.assertIsInstance(one_row_complex.c.timestamp.type, types.TIMESTAMP)
self.assertIsInstance(one_row_complex.c.binary.type, types.NullType)
self.assertIsInstance(one_row_complex.c.binary.type, types.VARBINARY)
self.assertIsInstance(one_row_complex.c.array.type, types.NullType)
self.assertIsInstance(one_row_complex.c.map.type, types.NullType)
self.assertIsInstance(one_row_complex.c.struct.type, types.NullType)

Просмотреть файл

@ -15,3 +15,15 @@ flake8-ignore =
pyhive/hive.py F405
pyhive/presto.py F405
W503
filterwarnings =
error
# For Python 2 flake8
default:You passed a bytestring as `filenames`:DeprecationWarning:flake8.options.config
default::UnicodeWarning:_pytest.warnings
# TODO For old sqlalchemy
default:cgi.parse_qsl is deprecated:PendingDeprecationWarning:sqlalchemy.engine.url
# TODO
default:Did not recognize type:sqlalchemy.exc.SAWarning
default:The Binary type has been renamed to LargeBinary:sqlalchemy.exc.SADeprecationWarning
default:'async' and 'await' will become reserved keywords:DeprecationWarning
default:Please use assertRaisesRegex instead:DeprecationWarning