laughingman7743 / pyathenajdbc Goto Github PK
View Code? Open in Web Editor NEWPyAthenaJDBC is an Amazon Athena JDBC driver wrapper for the Python DB API 2.0 (PEP 249).
License: MIT License
PyAthenaJDBC is an Amazon Athena JDBC driver wrapper for the Python DB API 2.0 (PEP 249).
License: MIT License
Currently I'm fetching a relatively large set of data using PyAthenaJDBC and the time to fetch the data tends to be extremely long.
We've experimented with using PyAthenaJDBC to just execute a query and then fetch it directly from S3 using boto and it was much faster. But this is clumsy because we don't know the query file name so fetching it must be done with mtimes and that is brittle.
Ideally we'd be able to execute a query and then just retrieve the S3 path of the query's output file. Is this possible?
thank you
Did I miss anything in the docs that would enable someone to execute a query on Athena, but get a qualified S3 URI which would point to the result of the query? This would be very useful when expecting a quite large dataset.
Keep up the good work. Great library!
awsathena+jdbc URI error
superset_1 | DEBUG:pyathenajdbc.connection:JVM args: ['-server', '-Djava.class.path=/usr/local/lib/python3.6/site-packages/pyathenajdbc/AthenaJDBC42_2.0.9.jar', '-Dlog4j.configuration=file:/usr/local/lib/python3.6/site-packages/pyathenajdbc/log4j.properties']
superset_1 | ERROR:superset.views.core:Unexpected error java.sql.SQLException: [Simba][AthenaJDBC](100131) An error has been thrown from the AWS SDK client. Unable to execute HTTP request: athena.athena.cn-northwest-1.amazonaws.com.cn.amazonaws.com: Name or service not known [Execution ID not available]
update https://github.com/laughingman7743/PyAthenaJDBC/blob/master/pyathenajdbc/sqlalchemy_athena.py#L120 as below
'region_name': re.sub(r'^athena\.([a-z0-9-]+)\.amazonaws\.(com.cn|com)$', r'\1', url.host),
@laughingman7743 Please help fix the issue, I have tested in my project
I just ran the sample code in the 'readme.md'.
I get the folowing exception:
Traceback (most recent call last):
File "handler.py", line 17, in <module>
""")
File "/Users/skyfall/Documents/workspace/test/python/pyathena/vendor/pyathenajdbc/cursor.py", line 113, in execute
reraise_dbapi_error()
File "/Users/skyfall/Documents/workspace/test/python/pyathena/vendor/pyathenajdbc/util.py", line 27, in reraise_dbapi_error
reraise(exc_type, exc_info[1], exc_info[2])
File "/Users/skyfall/Documents/workspace/test/python/pyathena/vendor/pyathenajdbc/cursor.py", line 102, in execute
result_set = self._statement.executeQuery(query)
pyathenajdbc.error.DatabaseError: java.sql.SQLException: Failed to run query
Is that correct code??
Signal handling should be improved if possible, because both:
are barely acceptable for interactive usage.
Hello,
I am using PyAthenaJDBC since the beginning and I believe it has been working like a charm,
Nevertheless, I was not able to perform the query to retrieve the description of my tables, the query is ran successfully as I can check it in the history. However, whenever I use any fetch method for the cursor, i get the following error :
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
You may find a sample of my code below, i would appreciate any help =)
class PyAthenaLoader():
def connecti(self):
self.conn = pyathenajdbc.connect(
s3_staging_dir="s3://bucket",
region_name="us-east-1",
log_path=log_path,
)
def desc(self, database, table):
"""
table description
:param database.table:
:return:
"""
self.connecti()
try:
with self.conn.cursor() as cursor:
cursor.execute('desc {0}.{1};'.format(database, table))
data = cursor.fetchall()
except Exception as X:
print(X.args[0])
return {'success': False, 'error': X.args[0]}
finally:
self.conn.close()
return {'success': True, 'data': data}
Hello,
I'm attempting to use some regex in my query and it appears that the {1,3} is causing the formatter to fail.
query = """
SELECT count(backend) AS count,
hbackend
FROM testing.{table}
WHERE REGEXP_LIKE (backend, '^\b\d{{1,3}}\.\d{{1,3}}\.\d{{1,3}}\.\d{{1,3}}\b$')
GROUP BY backend;""".format(table=table)
print query
try:
with conn.cursor() as cursor:
cursor.execute(query)
for row in cursor:
print(row)
finally:
conn.close()
Traceback (most recent call last):
File "run-queries.py", line 23, in <module>
cursor.execute(query)
File "/Library/Python/2.7/site-packages/pyathenajdbc/cursor.py", line 103, in execute
query = self._formatter.format(operation, *parameter_args, **parameter_kwargs)
File "/Library/Python/2.7/site-packages/pyathenajdbc/formatter.py", line 115, in format
return operation.format(*args, **kwargs).strip()
KeyError: '1,3'
My my work we have a separate "data" AWS account from the "production" account, and we use cross-account role assumption to do work in the data account. When I try the following code:
import pandas as pd
import sqlalchemy
engine = sqlalchemy.create_engine('awsathena+jdbc://athena.us-east-1.amazonaws.com:443/[DBNAME]?s3_staging_dir=s3://aws-athena-query-results-##########-us-east-1/}')
df = pd.read_sql("SELECT * FROM tablename", engine)
I get com.amazonaws.athena.jdbc.shaded.com.amazonaws.SdkClientException: To use assume role profiles the aws-java-sdk-sts module must be on the class path.
Any suggestions? I'm afraid I know very little Java.
My ~/.aws/config
file looks like:
[default]
region = us-east-1
output = json
[profile data]
role_arn = arn:aws:iam::############:role/cross-account-access-AdminCrossAccountRole
source_profile = default
Error message:
com.amazonaws.athena.jdbc.shaded.com.amazonaws.SdkClientExceptionPyRaisableTraceback (most recent call last)
<ipython-input-4-a8025bb4a742> in <module>()
----> 1 df = pd.read_sql("SELECT * FROM tablename", engine)
~/.local/share/virtualenvs/tmp-kRbPdue_/lib/python3.6/site-packages/pandas/io/sql.py in read_sql(sql, con, index_col, coerce_float, params, parse_dates, columns, chunksize)
414 sql, index_col=index_col, params=params,
415 coerce_float=coerce_float, parse_dates=parse_dates,
--> 416 chunksize=chunksize)
417
418
~/.local/share/virtualenvs/tmp-kRbPdue_/lib/python3.6/site-packages/pandas/io/sql.py in read_query(self, sql, index_col, coerce_float, parse_dates, params, chunksize)
1090 args = _convert_params(sql, params)
1091
-> 1092 result = self.execute(*args)
1093 columns = result.keys()
1094
~/.local/share/virtualenvs/tmp-kRbPdue_/lib/python3.6/site-packages/pandas/io/sql.py in execute(self, *args, **kwargs)
981 def execute(self, *args, **kwargs):
982 """Simple passthrough to SQLAlchemy connectable"""
--> 983 return self.connectable.execute(*args, **kwargs)
984
985 def read_table(self, table_name, index_col=None, coerce_float=True,
~/.local/share/virtualenvs/tmp-kRbPdue_/lib/python3.6/site-packages/sqlalchemy/engine/base.py in execute(self, statement, *multiparams, **params)
2072 """
2073
-> 2074 connection = self.contextual_connect(close_with_result=True)
2075 return connection.execute(statement, *multiparams, **params)
2076
~/.local/share/virtualenvs/tmp-kRbPdue_/lib/python3.6/site-packages/sqlalchemy/engine/base.py in contextual_connect(self, close_with_result, **kwargs)
2121 return self._connection_cls(
2122 self,
-> 2123 self._wrap_pool_connect(self.pool.connect, None),
2124 close_with_result=close_with_result,
2125 **kwargs)
~/.local/share/virtualenvs/tmp-kRbPdue_/lib/python3.6/site-packages/sqlalchemy/engine/base.py in _wrap_pool_connect(self, fn, connection)
2156 dialect = self.dialect
2157 try:
-> 2158 return fn()
2159 except dialect.dbapi.Error as e:
2160 if connection is None:
~/.local/share/virtualenvs/tmp-kRbPdue_/lib/python3.6/site-packages/sqlalchemy/pool.py in connect(self)
401 """
402 if not self._use_threadlocal:
--> 403 return _ConnectionFairy._checkout(self)
404
405 try:
~/.local/share/virtualenvs/tmp-kRbPdue_/lib/python3.6/site-packages/sqlalchemy/pool.py in _checkout(cls, pool, threadconns, fairy)
786 def _checkout(cls, pool, threadconns=None, fairy=None):
787 if not fairy:
--> 788 fairy = _ConnectionRecord.checkout(pool)
789
790 fairy._pool = pool
~/.local/share/virtualenvs/tmp-kRbPdue_/lib/python3.6/site-packages/sqlalchemy/pool.py in checkout(cls, pool)
530 @classmethod
531 def checkout(cls, pool):
--> 532 rec = pool._do_get()
533 try:
534 dbapi_connection = rec.get_connection()
~/.local/share/virtualenvs/tmp-kRbPdue_/lib/python3.6/site-packages/sqlalchemy/pool.py in _do_get(self)
1191 except:
1192 with util.safe_reraise():
-> 1193 self._dec_overflow()
1194 else:
1195 return self._do_get()
~/.local/share/virtualenvs/tmp-kRbPdue_/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py in __exit__(self, type_, value, traceback)
64 self._exc_info = None # remove potential circular references
65 if not self.warn_only:
---> 66 compat.reraise(exc_type, exc_value, exc_tb)
67 else:
68 if not compat.py3k and self._exc_info and self._exc_info[1]:
~/.local/share/virtualenvs/tmp-kRbPdue_/lib/python3.6/site-packages/sqlalchemy/util/compat.py in reraise(tp, value, tb, cause)
185 if value.__traceback__ is not tb:
186 raise value.with_traceback(tb)
--> 187 raise value
188
189 else:
~/.local/share/virtualenvs/tmp-kRbPdue_/lib/python3.6/site-packages/sqlalchemy/pool.py in _do_get(self)
1188 if self._inc_overflow():
1189 try:
-> 1190 return self._create_connection()
1191 except:
1192 with util.safe_reraise():
~/.local/share/virtualenvs/tmp-kRbPdue_/lib/python3.6/site-packages/sqlalchemy/pool.py in _create_connection(self)
348 """Called by subclasses to create a new ConnectionRecord."""
349
--> 350 return _ConnectionRecord(self)
351
352 def _invalidate(self, connection, exception=None, _checkin=True):
~/.local/share/virtualenvs/tmp-kRbPdue_/lib/python3.6/site-packages/sqlalchemy/pool.py in __init__(self, pool, connect)
475 self.__pool = pool
476 if connect:
--> 477 self.__connect(first_connect_check=True)
478 self.finalize_callback = deque()
479
~/.local/share/virtualenvs/tmp-kRbPdue_/lib/python3.6/site-packages/sqlalchemy/pool.py in __connect(self, first_connect_check)
669 try:
670 self.starttime = time.time()
--> 671 connection = pool._invoke_creator(self)
672 pool.logger.debug("Created new connection %r", connection)
673 self.connection = connection
~/.local/share/virtualenvs/tmp-kRbPdue_/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py in connect(connection_record)
104 if connection is not None:
105 return connection
--> 106 return dialect.connect(*cargs, **cparams)
107
108 creator = pop_kwarg('creator', connect)
~/.local/share/virtualenvs/tmp-kRbPdue_/lib/python3.6/site-packages/sqlalchemy/engine/default.py in connect(self, *cargs, **cparams)
408
409 def connect(self, *cargs, **cparams):
--> 410 return self.dbapi.connect(*cargs, **cparams)
411
412 def create_connect_args(self, url):
~/.local/share/virtualenvs/tmp-kRbPdue_/lib/python3.6/site-packages/pyathenajdbc/__init__.py in connect(s3_staging_dir, access_key, secret_key, region_name, schema_name, profile_name, credential_file, jvm_path, jvm_options, converter, formatter, driver_path, **kwargs)
64 region_name, schema_name, profile_name, credential_file,
65 jvm_path, jvm_options, converter, formatter,
---> 66 driver_path, **kwargs)
~/.local/share/virtualenvs/tmp-kRbPdue_/lib/python3.6/site-packages/pyathenajdbc/connection.py in __init__(self, s3_staging_dir, access_key, secret_key, region_name, schema_name, profile_name, credential_file, jvm_path, jvm_options, converter, formatter, driver_path, **driver_kwargs)
71 jpype.JClass(ATHENA_DRIVER_CLASS_NAME)
72 self._jdbc_conn = jpype.java.sql.DriverManager.getConnection(
---> 73 ATHENA_CONNECTION_STRING.format(region=self.region_name, schema=schema_name), props)
74
75 self._converter = converter if converter else JDBCTypeConverter()
com.amazonaws.athena.jdbc.shaded.com.amazonaws.SdkClientExceptionPyRaisable: com.amazonaws.athena.jdbc.shaded.com.amazonaws.SdkClientException: To use assume role profiles the aws-java-sdk-sts module must be on the class path.
Running Java 8 on OSX. Installed PyAthenaJDBC via pip. Python 3.6.
from pyathenajdbc import connect
conn = connect(s3_staging_dir='s3://YOUR_S3_BUCKET/path/to/',region_name='us-west-2')
---------------------------------------------------------------------------
java.lang.RuntimeExceptionPyRaisable Traceback (most recent call last)
<ipython-input-2-d12b72b4e202> in <module>()
1 conn = connect(s3_staging_dir='s3://YOUR_S3_BUCKET/path/to/',
----> 2 region_name='us-west-2')
3
~/anaconda/envs/python-jdbc/lib/python3.6/site-packages/pyathenajdbc/__init__.py in connect(s3_staging_dir, access_key, secret_key, region_name, schema_name, profile_name, credential_file, jvm_path, jvm_options, converter, formatter, driver_path, **kwargs)
64 region_name, schema_name, profile_name, credential_file,
65 jvm_path, jvm_options, converter, formatter,
---> 66 driver_path, **kwargs)
~/anaconda/envs/python-jdbc/lib/python3.6/site-packages/pyathenajdbc/connection.py in __init__(self, s3_staging_dir, access_key, secret_key, region_name, schema_name, profile_name, credential_file, jvm_path, jvm_options, converter, formatter, driver_path, **driver_kwargs)
67
68 props = self._build_driver_args(**driver_kwargs)
---> 69 jpype.JClass(ATHENA_DRIVER_CLASS_NAME)
70 self._jdbc_conn = jpype.java.sql.DriverManager.getConnection(
71 ATHENA_CONNECTION_STRING.format(region=self.region_name, schema=schema_name), props)
~/anaconda/envs/python-jdbc/lib/python3.6/site-packages/jpype/_jclass.py in JClass(name)
53 jc = _jpype.findClass(name)
54 if jc is None:
---> 55 raise _RUNTIMEEXCEPTION.PYEXC("Class %s not found" % name)
56
57 return _getClassFor(jc)
java.lang.RuntimeExceptionPyRaisable: java.lang.RuntimeException: Class com.amazonaws.athena.jdbc.AthenaDriver not found
$ java -version
java version "1.8.0_73"
Java(TM) SE Runtime Environment (build 1.8.0_73-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.73-b02, mixed mode)
Often the following error occurs :(
=================================== FAILURES ===================================
_______________ TestSQLAlchemyAthena.test_reflect_no_such_table ________________
def execute(self, operation, parameters=None):
if self.is_closed:
raise ProgrammingError('Connection is closed.')
query = self._formatter.format(operation, parameters)
try:
_logger.debug(query)
self._description = None
self._rownumber = 0
> result_set = self._statement.executeQuery(query)
E jpype._jexception.java.sql.SQLExceptionPyRaisable: java.sql.SQLException: Database, table or column name not found. Please check your query.
pyathenajdbc/cursor.py:108: java.sql.SQLExceptionPyRaisable
During handling of the above exception, another exception occurred:
def _execute_context(self, dialect, constructor,
statement, parameters,
*args):
"""Create an :class:`.ExecutionContext` and execute, returning
a :class:`.ResultProxy`."""
try:
try:
conn = self.__connection
except AttributeError:
conn = self._revalidate_connection()
context = constructor(dialect, self, conn, *args)
except BaseException as e:
self._handle_dbapi_exception(
e,
util.text_type(statement), parameters,
None, None)
if context.compiled:
context.pre_exec()
cursor, statement, parameters = context.cursor, \
context.statement, \
context.parameters
if not context.executemany:
parameters = parameters[0]
if self._has_events or self.engine._has_events:
for fn in self.dispatch.before_cursor_execute:
statement, parameters = \
fn(self, cursor, statement, parameters,
context, context.executemany)
if self._echo:
self.engine.logger.info(statement)
self.engine.logger.info(
"%r",
sql_util._repr_params(parameters, batches=10)
)
evt_handled = False
try:
if context.executemany:
if self.dialect._has_events:
for fn in self.dialect.dispatch.do_executemany:
if fn(cursor, statement, parameters, context):
evt_handled = True
break
if not evt_handled:
self.dialect.do_executemany(
cursor,
statement,
parameters,
context)
elif not parameters and context.no_parameters:
if self.dialect._has_events:
for fn in self.dialect.dispatch.do_execute_no_params:
if fn(cursor, statement, context):
evt_handled = True
break
if not evt_handled:
self.dialect.do_execute_no_params(
cursor,
statement,
context)
else:
if self.dialect._has_events:
for fn in self.dialect.dispatch.do_execute:
if fn(cursor, statement, parameters, context):
evt_handled = True
break
if not evt_handled:
self.dialect.do_execute(
cursor,
statement,
parameters,
> context)
.tox/py34/lib/python3.4/site-packages/sqlalchemy/engine/base.py:1182:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def do_execute(self, cursor, statement, parameters, context=None):
> cursor.execute(statement, parameters)
.tox/py34/lib/python3.4/site-packages/sqlalchemy/engine/default.py:470:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def execute(self, operation, parameters=None):
if self.is_closed:
raise ProgrammingError('Connection is closed.')
query = self._formatter.format(operation, parameters)
try:
_logger.debug(query)
self._description = None
self._rownumber = 0
result_set = self._statement.executeQuery(query)
if result_set:
self._result_set = result_set
self._meta_data = result_set.getMetaData()
self._update_count = -1
else:
self._result_set = None
self._meta_data = None
self._update_count = self._statement.getUpdatecount()
except Exception:
_logger.exception('Failed to execute query.')
> reraise_dbapi_error()
pyathenajdbc/cursor.py:119:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def reraise_dbapi_error():
exc_info = sys.exc_info()
import jpype
value = exc_info[1]
if isinstance(exc_info[1], jpype._jexception.JavaException):
if issubclass(exc_info[1].__javaclass__, jpype.java.sql.SQLException):
args = exc_info[1].args
if args:
cause = args[0].cause
if cause:
value = cause.getMessage()
else:
value = args[0].getMessage()
tp = DatabaseError
else:
tp = Error
else:
tp = exc_info[0]
> reraise(tp, value, exc_info[2])
pyathenajdbc/util.py:37:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def raise_(tp, value=None, tb=None):
"""
A function that matches the Python 2.x ``raise`` statement. This
allows re-raising exceptions with the cls value and traceback on
Python 2 and 3.
"""
if value is not None and isinstance(tp, Exception):
raise TypeError("instance exception may not have a separate value")
if value is not None:
exc = tp(value)
else:
exc = tp
if exc.__traceback__ is not tb:
> raise exc.with_traceback(tb)
.tox/py34/lib/python3.4/site-packages/future/utils/__init__.py:413:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def execute(self, operation, parameters=None):
if self.is_closed:
raise ProgrammingError('Connection is closed.')
query = self._formatter.format(operation, parameters)
try:
_logger.debug(query)
self._description = None
self._rownumber = 0
> result_set = self._statement.executeQuery(query)
E pyathenajdbc.error.DatabaseError: Database, table or column name not found. Please check your query.
pyathenajdbc/cursor.py:108: DatabaseError
The above exception was the direct cause of the following exception:
self = <tests.test_sqlalchemy_athena.TestSQLAlchemyAthena testMethod=test_reflect_no_such_table>
engine = Engine(awsathena+jdbc://athena.us-west-2.amazonaws.com:443/test_pyathena_jdbc_72fnv55x4q?s3_staging_dir=s3://laughingman7743.athena/circleci/)
conn = <sqlalchemy.engine.base.Connection object at 0x7f3bc004d6a0>
@with_engine
def test_reflect_no_such_table(self, engine, conn):
self.assertRaises(
NoSuchTableError,
> lambda: Table('this_does_not_exist', MetaData(bind=engine), autoload=True))
tests/test_sqlalchemy_athena.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_sqlalchemy_athena.py:52: in <lambda>
lambda: Table('this_does_not_exist', MetaData(bind=engine), autoload=True))
.tox/py34/lib/python3.4/site-packages/sqlalchemy/sql/schema.py:439: in __new__
metadata._remove_table(name, schema)
.tox/py34/lib/python3.4/site-packages/sqlalchemy/util/langhelpers.py:66: in __exit__
compat.reraise(exc_type, exc_value, exc_tb)
.tox/py34/lib/python3.4/site-packages/sqlalchemy/util/compat.py:187: in reraise
raise value
.tox/py34/lib/python3.4/site-packages/sqlalchemy/sql/schema.py:434: in __new__
table._init(name, metadata, *args, **kw)
.tox/py34/lib/python3.4/site-packages/sqlalchemy/sql/schema.py:514: in _init
include_columns, _extend_on=_extend_on)
.tox/py34/lib/python3.4/site-packages/sqlalchemy/sql/schema.py:540: in _autoload
_extend_on=_extend_on
.tox/py34/lib/python3.4/site-packages/sqlalchemy/engine/base.py:2037: in run_callable
return conn.run_callable(callable_, *args, **kwargs)
.tox/py34/lib/python3.4/site-packages/sqlalchemy/engine/base.py:1526: in run_callable
return callable_(self, *args, **kwargs)
.tox/py34/lib/python3.4/site-packages/sqlalchemy/engine/default.py:372: in reflecttable
table, include_columns, exclude_columns, **opts)
.tox/py34/lib/python3.4/site-packages/sqlalchemy/engine/reflection.py:598: in reflecttable
table_name, schema, **table.dialect_kwargs):
.tox/py34/lib/python3.4/site-packages/sqlalchemy/engine/reflection.py:369: in get_columns
**kw)
<string>:2: in get_columns
???
.tox/py34/lib/python3.4/site-packages/sqlalchemy/engine/reflection.py:54: in cache
ret = fn(self, con, *args, **kw)
pyathenajdbc/sqlalchemy_athena.py:145: in get_columns
} for row in connection.execute(query).fetchall()
.tox/py34/lib/python3.4/site-packages/sqlalchemy/engine/base.py:939: in execute
return self._execute_text(object, multiparams, params)
.tox/py34/lib/python3.4/site-packages/sqlalchemy/engine/base.py:1097: in _execute_text
statement, parameters
.tox/py34/lib/python3.4/site-packages/sqlalchemy/engine/base.py:1189: in _execute_context
context)
.tox/py34/lib/python3.4/site-packages/sqlalchemy/engine/base.py:1394: in _handle_dbapi_exception
exc_info
.tox/py34/lib/python3.4/site-packages/sqlalchemy/util/compat.py:203: in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
.tox/py34/lib/python3.4/site-packages/sqlalchemy/util/compat.py:186: in reraise
raise value.with_traceback(tb)
.tox/py34/lib/python3.4/site-packages/sqlalchemy/engine/base.py:1182: in _execute_context
context)
.tox/py34/lib/python3.4/site-packages/sqlalchemy/engine/default.py:470: in do_execute
cursor.execute(statement, parameters)
pyathenajdbc/cursor.py:119: in execute
reraise_dbapi_error()
pyathenajdbc/util.py:37: in reraise_dbapi_error
reraise(tp, value, exc_info[2])
.tox/py34/lib/python3.4/site-packages/future/utils/__init__.py:413: in raise_
raise exc.with_traceback(tb)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def execute(self, operation, parameters=None):
if self.is_closed:
raise ProgrammingError('Connection is closed.')
query = self._formatter.format(operation, parameters)
try:
_logger.debug(query)
self._description = None
self._rownumber = 0
> result_set = self._statement.executeQuery(query)
E sqlalchemy.exc.DatabaseError: (pyathenajdbc.error.DatabaseError) Database, table or column name not found. Please check your query. [SQL: '\n SELECT\n table_schema,\n table_name,\n column_name,\n data_type,\n is_nullable,\n column_default,\n ordinal_position,\n comment\n FROM information_schema.columns\n ']
pyathenajdbc/cursor.py:108: DatabaseError
------------------------------ Captured log call -------------------------------
credentials.py 1099 DEBUG Looking for credentials via: env
credentials.py 1099 DEBUG Looking for credentials via: assume-role
credentials.py 1099 DEBUG Looking for credentials via: shared-credentials-file
credentials.py 628 INFO Found credentials in shared credentials file: ~/.aws/credentials
converter.py 118 DEBUG {'TIMESTAMP': 93, 'DISTINCT': 2001, 'NCLOB': 2011, 'BIGINT': -5, 'STRUCT': 2002, 'LONGVARCHAR': -1, 'OTHER': 1111, 'SQLXML': 2009, 'DATE': 91, 'TIMESTAMP_WITH_TIMEZONE': 2014, 'BIT': -7, 'ROWID': -8, 'REAL': 7, 'SMALLINT': 5, 'DECIMAL': 3, 'NULL': 0, 'LONGNVARCHAR': -16, 'LONGVARBINARY': -4, 'BOOLEAN': 16, 'BLOB': 2004, 'FLOAT': 6, 'BINARY': -2, 'CLOB': 2005, 'JAVA_OBJECT': 2000, 'DOUBLE': 8, 'VARBINARY': -3, 'TIME_WITH_TIMEZONE': 2013, 'DATALINK': 70, 'NCHAR': -15, 'NVARCHAR': -9, 'INTEGER': 4, 'REF_CURSOR': 2012, 'VARCHAR': 12, 'NUMERIC': 2, 'TIME': 92, 'CHAR': 1, 'TINYINT': -6, 'ARRAY': 2003, 'REF': 2006}
credentials.py 1099 DEBUG Looking for credentials via: env
credentials.py 1099 DEBUG Looking for credentials via: assume-role
credentials.py 1099 DEBUG Looking for credentials via: shared-credentials-file
credentials.py 628 INFO Found credentials in shared credentials file: ~/.aws/credentials
converter.py 118 DEBUG {'TIMESTAMP': 93, 'DISTINCT': 2001, 'NCLOB': 2011, 'BIGINT': -5, 'STRUCT': 2002, 'LONGVARCHAR': -1, 'OTHER': 1111, 'SQLXML': 2009, 'DATE': 91, 'TIMESTAMP_WITH_TIMEZONE': 2014, 'BIT': -7, 'ROWID': -8, 'REAL': 7, 'SMALLINT': 5, 'DECIMAL': 3, 'NULL': 0, 'LONGNVARCHAR': -16, 'LONGVARBINARY': -4, 'BOOLEAN': 16, 'BLOB': 2004, 'FLOAT': 6, 'BINARY': -2, 'CLOB': 2005, 'JAVA_OBJECT': 2000, 'DOUBLE': 8, 'VARBINARY': -3, 'TIME_WITH_TIMEZONE': 2013, 'DATALINK': 70, 'NCHAR': -15, 'NVARCHAR': -9, 'INTEGER': 4, 'REF_CURSOR': 2012, 'VARCHAR': 12, 'NUMERIC': 2, 'TIME': 92, 'CHAR': 1, 'TINYINT': -6, 'ARRAY': 2003, 'REF': 2006}
cursor.py 105 DEBUG SELECT
table_schema,
table_name,
column_name,
data_type,
is_nullable,
column_default,
ordinal_position,
comment
FROM information_schema.columns
cursor.py 118 ERROR Failed to execute query.
Traceback (most recent call last):
File "/home/ubuntu/PyAthenaJDBC/pyathenajdbc/cursor.py", line 108, in execute
result_set = self._statement.executeQuery(query)
jpype._jexception.java.sql.SQLExceptionPyRaisable: java.sql.SQLException: Database, table or column name not found. Please check your query.
==================== 1 failed, 73 passed in 181.37 seconds =====================
The test is broken in Python3.5, 3.6, 3.7.
https://travis-ci.com/laughingman7743/PyAthenaJDBC/builds/144042238
https://travis-ci.com/laughingman7743/PyAthenaJDBC/jobs/274688960
==================================== ERRORS ====================================
_________________ ERROR at setup of TestCursor.test_arraysize __________________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
---------------------------- Captured stderr setup -----------------------------
ModuleNotFoundError: No module named 'numpy'
_____________ ERROR at setup of TestCursor.test_arraysize_default ______________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
_________________ ERROR at setup of TestCursor.test_bad_query __________________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
___________________ ERROR at setup of TestCursor.test_cancel ___________________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
__________________ ERROR at setup of TestCursor.test_complex ___________________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
____________ ERROR at setup of TestCursor.test_connection_is_closed ____________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
______ ERROR at setup of TestCursor.test_contain_special_character_query _______
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
_ ERROR at setup of TestCursor.test_contain_special_character_query_with_parameter _
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
______________ ERROR at setup of TestCursor.test_cursor_is_closed ______________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
________________ ERROR at setup of TestCursor.test_description _________________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
_____________ ERROR at setup of TestCursor.test_description_failed _____________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
____________ ERROR at setup of TestCursor.test_description_initial _____________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
___________________ ERROR at setup of TestCursor.test_escape ___________________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
__________________ ERROR at setup of TestCursor.test_fetchall __________________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
_________________ ERROR at setup of TestCursor.test_fetchmany __________________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
__________________ ERROR at setup of TestCursor.test_fetchone __________________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
______________ ERROR at setup of TestCursor.test_fetchone_no_data ______________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
_____________ ERROR at setup of TestCursor.test_invalid_arraysize ______________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
_______________ ERROR at setup of TestCursor.test_invalid_params _______________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
__________________ ERROR at setup of TestCursor.test_iterator __________________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
____________ ERROR at setup of TestCursor.test_multiple_connection _____________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
___________________ ERROR at setup of TestCursor.test_no_ops ___________________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
_________________ ERROR at setup of TestCursor.test_no_params __________________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
______________ ERROR at setup of TestCursor.test_none_empty_query ______________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
____________________ ERROR at setup of TestCursor.test_null ____________________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
_________________ ERROR at setup of TestCursor.test_null_param _________________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
_________________ ERROR at setup of TestCursor.test_open_close _________________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
__________________ ERROR at setup of TestCursor.test_unicode ___________________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
_________ ERROR at setup of TestParameterFormatter.test_add_partition __________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
_________ ERROR at setup of TestParameterFormatter.test_drop_partition _________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
______ ERROR at setup of TestParameterFormatter.test_format_bad_parameter ______
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
__________ ERROR at setup of TestParameterFormatter.test_format_bool ___________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
________ ERROR at setup of TestParameterFormatter.test_format_bool_list ________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
__________ ERROR at setup of TestParameterFormatter.test_format_date ___________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
________ ERROR at setup of TestParameterFormatter.test_format_date_list ________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
________ ERROR at setup of TestParameterFormatter.test_format_datetime _________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
______ ERROR at setup of TestParameterFormatter.test_format_datetime_list ______
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
_________ ERROR at setup of TestParameterFormatter.test_format_decimal _________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
______ ERROR at setup of TestParameterFormatter.test_format_decimal_list _______
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
__________ ERROR at setup of TestParameterFormatter.test_format_float __________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
_______ ERROR at setup of TestParameterFormatter.test_format_float_list ________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
___________ ERROR at setup of TestParameterFormatter.test_format_int ___________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
________ ERROR at setup of TestParameterFormatter.test_format_int_list _________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
__________ ERROR at setup of TestParameterFormatter.test_format_none ___________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
________ ERROR at setup of TestParameterFormatter.test_format_none_list ________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
___________ ERROR at setup of TestParameterFormatter.test_format_str ___________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
________ ERROR at setup of TestParameterFormatter.test_format_str_list _________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
_________ ERROR at setup of TestParameterFormatter.test_format_unicode _________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
______ ERROR at setup of TestParameterFormatter.test_format_unicode_list _______
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
___________ ERROR at setup of TestSQLAlchemyAthena.test_basic_query ____________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
___________ ERROR at setup of TestSQLAlchemyAthena.test_char_length ____________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
_ ERROR at setup of TestSQLAlchemyAthena.test_contain_percents_character_query _
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
_ ERROR at setup of TestSQLAlchemyAthena.test_contain_percents_character_query_with_parameter _
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
_________ ERROR at setup of TestSQLAlchemyAthena.test_get_column_type __________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
___________ ERROR at setup of TestSQLAlchemyAthena.test_get_columns ____________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
_________ ERROR at setup of TestSQLAlchemyAthena.test_get_table_names __________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
____________ ERROR at setup of TestSQLAlchemyAthena.test_has_table _____________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
_______ ERROR at setup of TestSQLAlchemyAthena.test_query_with_parameter _______
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
______ ERROR at setup of TestSQLAlchemyAthena.test_reflect_no_such_table _______
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
_________ ERROR at setup of TestSQLAlchemyAthena.test_reflect_schemas __________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
__________ ERROR at setup of TestSQLAlchemyAthena.test_reflect_select __________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
__________ ERROR at setup of TestSQLAlchemyAthena.test_reflect_table ___________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
__ ERROR at setup of TestSQLAlchemyAthena.test_reflect_table_include_columns ___
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
____ ERROR at setup of TestSQLAlchemyAthena.test_reflect_table_with_schema _____
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
__________ ERROR at setup of TestSQLAlchemyAthena.test_reserved_words __________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
_____________ ERROR at setup of TestSQLAlchemyAthena.test_unicode ______________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
_________________ ERROR at setup of TestUtil.test_to_datetime __________________
request = <SubRequest '_setup_session' for <TestCaseFunction test_arraysize>>
@pytest.fixture(scope='session', autouse=True)
def _setup_session(request):
request.addfinalizer(_teardown_session)
> with contextlib.closing(connect()) as conn:
tests/conftest.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyathenajdbc/__init__.py:65: in connect
from pyathenajdbc.connection import Connection
pyathenajdbc/connection.py:8: in <module>
import jpype
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
.tox/py37/lib/python3.7/site-packages/jpype/__init__.py:17: ImportError
______________________ ERROR at teardown of FLAKE8-check _______________________
self = <_HookCaller 'pytest_runtest_teardown'>, args = ()
kwargs = {'item': <Flake8Item util.py>, 'nextitem': None}, notincall = set()
def __call__(self, *args, **kwargs):
if args:
raise TypeError("hook calling supports only keyword arguments")
assert not self.is_historic()
if self.spec and self.spec.argnames:
notincall = (
set(self.spec.argnames) - set(["__multicall__"]) - set(kwargs.keys())
)
if notincall:
warnings.warn(
"Argument(s) {} which are declared in the hookspec "
"can not be found in this hook call".format(tuple(notincall)),
stacklevel=2,
)
> return self._hookexec(self, self.get_hookimpls(), kwargs)
.tox/py37/lib/python3.7/site-packages/pluggy/hooks.py:286:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0x7fd8929c7048>
hook = <_HookCaller 'pytest_runtest_teardown'>
methods = [<HookImpl plugin_name='runner', plugin=<module '_pytest.runner' from '/home/travis/build/laughingman7743/PyAthenaJDBC...m util.py>>>, <HookImpl plugin_name='logging-plugin', plugin=<_pytest.logging.LoggingPlugin object at 0x7fd88cd88358>>]
kwargs = {'item': <Flake8Item util.py>, 'nextitem': None}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
.tox/py37/lib/python3.7/site-packages/pluggy/manager.py:93:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_teardown'>
methods = [<HookImpl plugin_name='runner', plugin=<module '_pytest.runner' from '/home/travis/build/laughingman7743/PyAthenaJDBC...m util.py>>>, <HookImpl plugin_name='logging-plugin', plugin=<_pytest.logging.LoggingPlugin object at 0x7fd88cd88358>>]
kwargs = {'item': <Flake8Item util.py>, 'nextitem': None}
self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
methods,
kwargs,
> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
)
.tox/py37/lib/python3.7/site-packages/pluggy/manager.py:87:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <Flake8Item util.py>, nextitem = None
def pytest_runtest_teardown(item, nextitem):
_update_current_test_var(item, "teardown")
> item.session._setupstate.teardown_exact(item, nextitem)
.tox/py37/lib/python3.7/site-packages/_pytest/runner.py:146:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.runner.SetupState object at 0x7fd88cd98e80>
item = <Flake8Item util.py>, nextitem = None
def teardown_exact(self, item, nextitem):
needed_collectors = nextitem and nextitem.listchain() or []
> self._teardown_towards(needed_collectors)
.tox/py37/lib/python3.7/site-packages/_pytest/runner.py:331:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.runner.SetupState object at 0x7fd88cd98e80>
needed_collectors = []
def _teardown_towards(self, needed_collectors):
exc = None
while self.stack:
if self.stack == needed_collectors[: len(self.stack)]:
break
try:
self._pop_and_teardown()
except TEST_OUTCOME:
# XXX Only first exception will be seen by user,
# ideally all should be reported.
if exc is None:
exc = sys.exc_info()
if exc:
_, val, tb = exc
assert val is not None
> raise val.with_traceback(tb)
.tox/py37/lib/python3.7/site-packages/_pytest/runner.py:348:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.runner.SetupState object at 0x7fd88cd98e80>
needed_collectors = []
def _teardown_towards(self, needed_collectors):
exc = None
while self.stack:
if self.stack == needed_collectors[: len(self.stack)]:
break
try:
> self._pop_and_teardown()
.tox/py37/lib/python3.7/site-packages/_pytest/runner.py:339:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.runner.SetupState object at 0x7fd88cd98e80>
def _pop_and_teardown(self):
colitem = self.stack.pop()
> self._teardown_with_finalization(colitem)
.tox/py37/lib/python3.7/site-packages/_pytest/runner.py:297:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.runner.SetupState object at 0x7fd88cd98e80>
colitem = <Session PyAthenaJDBC exitstatus=<ExitCode.OK: 0> testsfailed=67 testscollected=83>
def _teardown_with_finalization(self, colitem):
> self._callfinalizers(colitem)
.tox/py37/lib/python3.7/site-packages/_pytest/runner.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.runner.SetupState object at 0x7fd88cd98e80>
colitem = <Session PyAthenaJDBC exitstatus=<ExitCode.OK: 0> testsfailed=67 testscollected=83>
def _callfinalizers(self, colitem):
finalizers = self._finalizers.pop(colitem, None)
exc = None
while finalizers:
fin = finalizers.pop()
try:
fin()
except TEST_OUTCOME:
# XXX Only first exception will be seen by user,
# ideally all should be reported.
if exc is None:
exc = sys.exc_info()
if exc:
_, val, tb = exc
assert val is not None
> raise val.with_traceback(tb)
.tox/py37/lib/python3.7/site-packages/_pytest/runner.py:314:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.runner.SetupState object at 0x7fd88cd98e80>
colitem = <Session PyAthenaJDBC exitstatus=<ExitCode.OK: 0> testsfailed=67 testscollected=83>
def _callfinalizers(self, colitem):
finalizers = self._finalizers.pop(colitem, None)
exc = None
while finalizers:
fin = finalizers.pop()
try:
> fin()
.tox/py37/lib/python3.7/site-packages/_pytest/runner.py:305:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <FixtureDef argname='_setup_session' scope='session' baseid='tests'>
request = <SubRequest '_setup_session' for <TestCaseFunction test_to_datetime>>
def finish(self, request):
exceptions = []
try:
while self._finalizers:
try:
func = self._finalizers.pop()
func()
except: # noqa
exceptions.append(sys.exc_info())
if exceptions:
_, val, tb = exceptions[0]
# Ensure to not keep frame references through traceback.
del exceptions
> raise val.with_traceback(tb)
.tox/py37/lib/python3.7/site-packages/_pytest/fixtures.py:872:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <FixtureDef argname='_setup_session' scope='session' baseid='tests'>
request = <SubRequest '_setup_session' for <TestCaseFunction test_to_datetime>>
def finish(self, request):
exceptions = []
try:
while self._finalizers:
try:
func = self._finalizers.pop()
> func()
.tox/py37/lib/python3.7/site-packages/_pytest/fixtures.py:865:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def _teardown_session():
> with contextlib.closing(connect()) as conn:
tests/conftest.py:32:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
s3_staging_dir = None, access_key = None, secret_key = None, region_name = None
schema_name = 'default', profile_name = None, credential_file = None
jvm_path = None, jvm_options = None, converter = None, formatter = None
driver_path = None, log4j_conf = None, kwargs = {}
def connect(s3_staging_dir=None, access_key=None, secret_key=None,
region_name=None, schema_name='default', profile_name=None, credential_file=None,
jvm_path=None, jvm_options=None, converter=None, formatter=None,
driver_path=None, log4j_conf=None, **kwargs):
> from pyathenajdbc.connection import Connection
pyathenajdbc/__init__.py:65:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
from __future__ import absolute_import
from __future__ import unicode_literals
import logging
import os
> import jpype
pyathenajdbc/connection.py:8:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> import _jpype
E ImportError: numpy.core.multiarray failed to import
I'm having difficulty using the profile_name parameter unless the profile's name is "default" in the credentials file. This issue is similar to Issue 51, although it looks like the source code for connection.py has changed since the commit to resolve issue 51 - I wasn't able to find profile_name, token, etc. as arguments in the present source code I looked at. Regardless, those arguments are included in the Python code below.
The credentials file I'm using for AWS changes constantly due to security reasons, and incorporates multiple roles (with none of them named "default"). I'm hoping there's a way to use PyAthenaJBDC to account for changing keys and tokens for multiple profiles when connecting to Athena.
Thank you for your time!
I have a credentials file that looks like this (~/.aws/credentials):
[user-123]
aws_access_key_id = aaaaaaaa
aws_secret_access_key = bbbbbbbb
aws_session_token = cccccccc
[user-456]
aws_access_key_id = dddddddd
aws_secret_access_key = eeeeeeee
aws_session_token = ffffffff
The code below will not run with the credentials file above:
from pyathenajdbc import connect
from boto3 import Session
aws = Session(profile_name = "user-123")
credentials = aws.get_credentials().get_frozen_credentials()
connect(access_key = credentials.access_key,
secret_key = credentials.secret_key,
token = credentials.token,
profile_name = aws.profile_name,
s3_staging_dir = 's3://BUCKET/',
AwsRegion = aws.region_name
)
However, the code runs if I change the name of one credential to "default":
[default]
aws_access_key_id = aaaaaaaa
aws_secret_access_key = bbbbbbbb
aws_session_token = cccccccc
[user-456]
aws_access_key_id = dddddddd
aws_secret_access_key = eeeeeeee
aws_session_token = ffffffff
Then change the Python code to have profile_name as "default":
from pyathenajdbc import connect
from boto3 import Session
aws = Session(profile_name = "default")
credentials = aws.get_credentials().get_frozen_credentials()
connect(access_key = credentials.access_key,
secret_key = credentials.secret_key,
token = credentials.token,
profile_name = aws.profile_name,
s3_staging_dir = 's3://BUCKET/',
AwsRegion = aws.region_name
)
http://docs.aws.amazon.com/ja_jp/athena/latest/APIReference/API_GetQueryExecution.html
Get AthenaServiceClient by reflection and call getQueryExecution method.
Hello,
with pip install athenajdbc i can see that there are two versions of JAR files :
root@9654d30c6a8c:/opt/site_packages# ls -alh /opt/site_packages/pyathenajdbc/
total 20M
drwxr-xr-x. 2 root root 4.0K May 18 11:59 .
drwxr-xr-x. 54 root root 4.0K May 18 12:01 ..
-rw-r--r--. 1 root root 9.5M May 18 11:59 AthenaJDBC41-1.0.0.jar
-rw-r--r--. 1 root root 11M May 18 11:59 AthenaJDBC41-1.0.1.jar
-rw-r--r--. 1 root root 2.2K May 18 11:59 __init__.py
-rw-r--r--. 1 root root 2.7K May 18 11:59 __init__.pyc
-rw-r--r--. 1 root root 6.2K May 18 11:59 connection.py
-rw-r--r--. 1 root root 6.6K May 18 11:59 connection.pyc
-rw-r--r--. 1 root root 4.4K May 18 11:59 converter.py
-rw-r--r--. 1 root root 5.5K May 18 11:59 converter.pyc
-rw-r--r--. 1 root root 5.7K May 18 11:59 cursor.py
-rw-r--r--. 1 root root 7.5K May 18 11:59 cursor.pyc
-rw-r--r--. 1 root root 713 May 18 11:59 error.py
-rw-r--r--. 1 root root 2.4K May 18 11:59 error.pyc
-rw-r--r--. 1 root root 3.7K May 18 11:59 formatter.py
-rw-r--r--. 1 root root 5.0K May 18 11:59 formatter.pyc
-rw-r--r--. 1 root root 5.7K May 18 11:59 sqlalchemy_athena.py
-rw-r--r--. 1 root root 7.6K May 18 11:59 sqlalchemy_athena.pyc
-rw-r--r--. 1 root root 1.6K May 18 11:59 util.py
-rw-r--r--. 1 root root 2.5K May 18 11:59 util.pyc
Do we require both?
When following the documentation in the README I get:
Traceback (most recent call last):
File "test.py", line 7, in <module>
region_name='us-east-1')
File "/Library/Python/2.7/site-packages/pyathenajdbc/__init__.py", line 66, in connect
driver_path, **kwargs)
File "/Library/Python/2.7/site-packages/pyathenajdbc/connection.py", line 69, in __init__
jpype.JClass(ATHENA_DRIVER_CLASS_NAME)
File "/Library/Python/2.7/site-packages/jpype/_jclass.py", line 55, in JClass
raise _RUNTIMEEXCEPTION.PYEXC("Class %s not found" % name)
jpype._jexception.RuntimeExceptionPyRaisable: java.lang.RuntimeException: Class com.amazonaws.athena.jdbc.AthenaDriver not found
I see that the AthenaJDBC41-1.0.1.jar file has been downloaded into the package folder, but seems like I'm missing a step here. I'm not a Java guy so is it possible there's just a shared location I need to put the jar?
Thanks
I'm using version 1.3.0 and getting:
log4j:WARN No appenders could be found for logger (com.amazonaws.athena.jdbc.AthenaDriver)
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
I use the connect function (from pyathenajdbc import connect
)
What is it ?
The InstanceProfileCredentialsProvider
only works on EC2 Instances whereas the DefaultAWSCredentialsProviderChain will work on EC2 Instances, ECS, Lambda, and the CLI.
I am trying to write an Airflow hook for connecting to Athena, and I'm getting this error about 'Athena JDBC connection is only supported for auto-commit mode.' Can you offer any insight into this error?
`class AthenaHook(S3Hook):
"""
Hook to work with Athena and associated data in S3 buckets.
"""
def __init__(self, s3_staging_dir, aws_conn_id):
self.region_name = None
self.conn = None
self.s3_staging_dir = s3_staging_dir
super(AthenaHook, self).__init__(aws_conn_id)
def connect(self,**kwargs):
"""
Connect to Athena using JDBC. Credentials handled by S3hook
"""
credentials = map(str, self.get_credentials())
self.conn = jdbc_connect(
s3_staging_dir=self.s3_staging_dir,
access_key=credentials[0],
secret_key=credentials[1],
region_name=self.region_name
)
def dataframe(self, query):
"""
Pull the results of a query into a data frame
Args:
query(str): A SQL query to be run in Athena.
Returns:
(pd.DataFrame): A dataframe containing the results of the query
"""
return pd.read_sql(query, self.conn)
class AthenaPlugin(AirflowPlugin):
name = "athena_plugin"
hooks = [AthenaHook]
`
Here is the traceback:
In [15]: hook.dataframe('SELECT * from posterior_db.strain_posterior_local LIMIT 10')
[2017-11-08 14:19:27,349] {cursor.py:193} ERROR - Failed to execute query.
Traceback (most recent call last):
File "/home/rness/projects/ztl/venv/lib/python2.7/site-packages/pyathenajdbc/cursor.py", line 172, in execute
result_set = self._statement.executeQuery(query)
java.sql.SQLExceptionPyRaisable: java.sql.SQLException: Failed to run queryDatabaseError Traceback (most recent call last)
in ()
----> 1 hook.dataframe('SELECT * from posterior_db.strain_posterior_local LIMIT 10')/home/rness/projects/ztl/zflow/plugins/athena_plugin.pyc in dataframe(self, query)
55 (pd.DataFrame): A dataframe containing the results of the query
56 """
---> 57 return pd.read_sql(query, self.conn)
58
59/home/rness/projects/ztl/venv/lib/python2.7/site-packages/pandas/io/sql.pyc in read_sql(sql, con, index_col, coerce_float, params, parse_dates, columns, chunksize)
397 sql, index_col=index_col, params=params,
398 coerce_float=coerce_float, parse_dates=parse_dates,
--> 399 chunksize=chunksize)
400
401 try:/home/rness/projects/ztl/venv/lib/python2.7/site-packages/pandas/io/sql.pyc in read_query(self, sql, index_col, coerce_float, params, parse_dates, chunksize)
1434
1435 args = _convert_params(sql, params)
-> 1436 cursor = self.execute(*args)
1437 columns = [col_desc[0] for col_desc in cursor.description]
1438/home/rness/projects/ztl/venv/lib/python2.7/site-packages/pandas/io/sql.pyc in execute(self, *args, **kwargs)
1407 ex = DatabaseError("Execution failed on sql: %s\n%s\nunable"
1408 " to rollback" % (args[0], exc))
-> 1409 raise_with_traceback(ex)
1410
1411 ex = DatabaseError(/home/rness/projects/ztl/venv/lib/python2.7/site-packages/pandas/io/sql.pyc in execute(self, *args, **kwargs)
1403 except Exception as exc:
1404 try:
-> 1405 self.con.rollback()
1406 except Exception: # pragma: no cover
1407 ex = DatabaseError("Execution failed on sql: %s\n%s\nunable"/home/rness/projects/ztl/venv/lib/python2.7/site-packages/pyathenajdbc/connection.pyc in rollback(self)
148
149 def rollback(self):
--> 150 raise NotSupportedError('Athena JDBC connection is only supported for auto-commit mode.')DatabaseError: Execution failed on sql: SELECT * from posterior_db.strain_posterior_local LIMIT 10
java.sql.SQLException: Failed to run query
unable to rollback
Hello everyone,
i am currently working on the get_columns
dialect method. I have a decent implementation (sdia-zz@da61f6c) I was about to submit as PR. But I am stuck because I can get the tests working in my local dev, even without my changes.
Are you aware of any issues on test_sqlalchemy_athena
?
Is it fine if I just submit my PR without tests ?
============================================================================================================ test session starts =============================================================================================================
platform darwin -- Python 2.7.13, pytest-3.2.2, py-1.4.34, pluggy-0.4.0
rootdir: /private/tmp/PyAthenaJDBC, inifile: setup.cfg
collected 65 items
tests/test_cursor.py ...............................
tests/test_formatter.py .....................
tests/test_sqlalchemy_athena.py ....F.F.....
tests/test_util.py .
================================================================================================================== FAILURES ==================================================================================================================
______________________________________________________________________________________________ TestSQLAlchemyAthena.test_reflect_no_such_table _______________________________________________________________________________________________
self = <tests.test_sqlalchemy_athena.TestSQLAlchemyAthena testMethod=test_reflect_no_such_table>, args = (), kwargs = {}
engine = Engine(awsathena+jdbc://athena.us-west-2.amazonaws.com:443/test_pyathena_jdbc_fzfz7mqn8g?s3_staging_dir=s3://clm-tmp/sdia/), conn = <sqlalchemy.engine.base.Connection object at 0x1224cb3d0>
@functools.wraps(fn)
def wrapped_fn(self, *args, **kwargs):
engine = self.create_engine()
try:
with contextlib.closing(engine.connect()) as conn:
> fn(self, engine, conn, *args, **kwargs)
tests/util.py:36:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_sqlalchemy_athena.py:53: in test_reflect_no_such_table
lambda: Table('this_does_not_exist', MetaData(bind=engine), autoload=True))
tests/test_sqlalchemy_athena.py:53: in <lambda>
lambda: Table('this_does_not_exist', MetaData(bind=engine), autoload=True))
/usr/local/lib/python2.7/site-packages/sqlalchemy/sql/schema.py:439: in __new__
metadata._remove_table(name, schema)
/usr/local/lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py:66: in __exit__
compat.reraise(exc_type, exc_value, exc_tb)
/usr/local/lib/python2.7/site-packages/sqlalchemy/sql/schema.py:434: in __new__
table._init(name, metadata, *args, **kw)
/usr/local/lib/python2.7/site-packages/sqlalchemy/sql/schema.py:514: in _init
include_columns, _extend_on=_extend_on)
/usr/local/lib/python2.7/site-packages/sqlalchemy/sql/schema.py:540: in _autoload
_extend_on=_extend_on
/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py:2045: in run_callable
return conn.run_callable(callable_, *args, **kwargs)
/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py:1534: in run_callable
return callable_(self, *args, **kwargs)
/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py:372: in reflecttable
table, include_columns, exclude_columns, **opts)
/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/reflection.py:598: in reflecttable
table_name, schema, **table.dialect_kwargs):
/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/reflection.py:369: in get_columns
**kw)
<string>:2: in get_columns
???
/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/reflection.py:54: in cache
ret = fn(self, con, *args, **kw)
pyathenajdbc/sqlalchemy_athena.py:127: in get_columns
res = connection.execute(query).fetchall()
/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py:939: in execute
return self._execute_text(object, multiparams, params)
/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py:1097: in _execute_text
statement, parameters
/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py:1189: in _execute_context
context)
/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py:1402: in _handle_dbapi_exception
exc_info
/usr/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py:203: in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py:1182: in _execute_context
context)
/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py:470: in do_execute
cursor.execute(statement, parameters)
pyathenajdbc/util.py:34: in _wrapper
return wrapped(*args, **kwargs)
pyathenajdbc/util.py:24: in _wrapper
return wrapped(*args, **kwargs)
pyathenajdbc/cursor.py:194: in execute
raise_from(DatabaseError(*e.args), e)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
exc = DatabaseError(<jpype._jclass.java.sql.SQLException object at 0x1228987d0>,), cause = SQLExceptionPyRaisable(<jpype._jclass.java.sql.SQLException object at 0x1228987d0>,)
def raise_from(exc, cause):
"""
Equivalent to:
raise EXCEPTION from CAUSE
on Python 3. (See PEP 3134).
"""
# Is either arg an exception class (e.g. IndexError) rather than
# instance (e.g. IndexError('my message here')? If so, pass the
# name of the class undisturbed through to "raise ... from ...".
if isinstance(exc, type) and issubclass(exc, Exception):
e = exc()
# exc = exc.__name__
# execstr = "e = " + _repr_strip(exc) + "()"
# myglobals, mylocals = _get_caller_globals_and_locals()
# exec(execstr, myglobals, mylocals)
else:
e = exc
e.__suppress_context__ = False
if isinstance(cause, type) and issubclass(cause, Exception):
e.__cause__ = cause()
e.__suppress_context__ = True
elif cause is None:
e.__cause__ = None
e.__suppress_context__ = True
elif isinstance(cause, BaseException):
e.__cause__ = cause
e.__suppress_context__ = True
else:
raise TypeError("exception causes must derive from BaseException")
e.__context__ = sys.exc_info()[1]
> raise e
E DatabaseError: (pyathenajdbc.error.DatabaseError) java.sql.SQLException: FAILED: SemanticException [Error 10001]: Table not found test_pyathena_jdbc_fzfz7mqn8g.this_does_not_exist [SQL: u'SHOW CREATE TABLE test_pyathena_jdbc_fzfz7mqn8g.this_does_not_exist']
/usr/local/lib/python2.7/site-packages/future/utils/__init__.py:454: DatabaseError
__________________________________________________________________________________________________ TestSQLAlchemyAthena.test_reflect_select __________________________________________________________________________________________________
self = <tests.test_sqlalchemy_athena.TestSQLAlchemyAthena testMethod=test_reflect_select>, args = (), kwargs = {}
engine = Engine(awsathena+jdbc://athena.us-west-2.amazonaws.com:443/test_pyathena_jdbc_fzfz7mqn8g?s3_staging_dir=s3://clm-tmp/sdia/), conn = <sqlalchemy.engine.base.Connection object at 0x1228a7050>
@functools.wraps(fn)
def wrapped_fn(self, *args, **kwargs):
engine = self.create_engine()
try:
with contextlib.closing(engine.connect()) as conn:
> fn(self, engine, conn, *args, **kwargs)
tests/util.py:36:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_sqlalchemy_athena.py:152: in test_reflect_select
self.assertIsInstance(one_row_complex.c.col_int.type, INTEGER)
E AssertionError: NullType() is not an instance of <class 'sqlalchemy.sql.sqltypes.INTEGER'>
------------------------------------------------------------------------------------------------------------ Captured stdout call ------------------------------------------------------------------------------------------------------------
BOOLEAN
TINYINT
SMALLINT
INT
BIGINT
FLOAT
DOUBLE
STRING
TIMESTAMP
DATE
BINARY
ARRAY<INT>
MAP<INT,INT>
STRUCT<A:INT,B:INT>
DECIMAL(10,1)
=================================================================================================== 2 failed, 63 passed in 180.05 seconds ====================================================================================================
Hi, I'm getting this warning:
WARNING: Illegal reflective access by com.simba.athena.shaded.fasterxml.jackson.databind.util.ClassUtil (file:/Users/olmo/anaconda3/envs/bsk/lib/python3.6/site-packages/pyathenajdbc/AthenaJDBC42_2.0.7.jar) to field java.lang.Throwable.cause
WARNING: Please consider reporting this to the maintainers of com.simba.athena.shaded.fasterxml.jackson.databind.util.ClassUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
I see this when I run the following code
def get_conn_athena():
s3_staging_dir = 's3://vblabla/parquet/'
schema_name = 'blablabla'
conn_athena = connect(
s3_staging_dir=s3_staging_dir,
schema_name=schema_name,
region_name='eu-central-1',
S3OutputLocation=s3_staging_dir + "query_results/"
)
return conn_athena
conn_athena = get_conn_athena()
cur_athena = conn_athena.cursor()
sql = """
SELECT max(seen_time_rounded) as seen_time_rounded
FROM {source_table_name}
WHERE api_id = %(api_id)s
and seen_time_rounded < %(now_formatted_as_seen_time_rounded)s;
""".format(source_table_name='mytable')
cur = cur_athena
params = dict(
api_id=api_id,
now_formatted_as_seen_time_rounded=datetime.now().strftime('%Y-%m-%d-%H-%M')
)
cur.execute(sql, params)
any idea why this is happening? happy to help debugging if necessary.
Hi all, in the last 3 days I've been experiencing the error segmentation fault (core dumped) when I try to run a query on Athena.
I've been using this lib for a long time and this started to happen when I started using the libs pymssql and pysftp in the same repo, I do not know if this can help to identify.
When debugging the error I discovered that the error happens in the connection.py class in from future.utils import iteritems in this line of code:
# Listvalues and listitems definitions from Nick Coghlan's (withdrawn)
# PEP 496:
Try:
Dict.iteritems
Except AttributeError:
# Python 3
Def listvalues (d):
Return list (d.values ())
Def listitems (d):
Return list (d.items ())
I also debug via gdb, traceback follows:
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffeea6b700 (LWP 25625)]
[New Thread 0x7fffee26a700 (LWP 25626)]
[New Thread 0x7fffe9a69700 (LWP 25627)]
2017-06-29 22: 21: 23.198238 - Downloading sms ...
Installing openjdk unwinder
Traceback (most recent call last):
File "/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so-gdb.py", line 52, in <module >
Class Types (object):
File "/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so-gdb.py", line 66, in Types
Nmethodp_t = gdb.lookup_type ('nmethod'). Pointer ()
Gdb.error: No type named nmethod.
Thread 1 "python" received signal SIGSEGV, Segmentation fault.
0x00007fffcfc552b4 in ?? ()
After bt full command
# 0 0x00007fffcfc552b4 in ?? ()
No symbol table info available.
# 1 0x0000000000000246 in ?? ()
No symbol table info available.
# 2 0x00007fffcfc55160 in ?? ()
No symbol table info available.
# 3 0x00007fffffff8da0 in ?? ()
No symbol table info available.
# 4 0x00007fffffff8d40 in ?? ()
No symbol table info available.
# 5 0x00007fffe0342035 in VM_Version :: get_processor_features () () from /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so
No symbol table info available.
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Can anyone help me with this problem?
I have been receiving this error since yesterday:
validation error detected: Value null at 'outputLocation'
This is my connection string:
conn = connect(
s3_staging_dir='s3://aws-athena-query-results-{}-us-east-1/'.format(env.get('AWS_ACCOUNT_ID')),
region_name='us-east-1',
access_key=kms.decrypt(access_key_encrypted),
secret_key=kms.decrypt(secret_key_encrypted),
)
Hi!
Is there any way to get Athena QueryID in pyathenajdbc?
I use PyAthenaJDBC to query data and store then in local. But when I send query to Athena, it will always save the query result in s3. So I wonder if there is a way to get that directly, instead of save it to local.
Thanks,
Eva
getQueryID
in cursor to return the executed query ID.I get a new exception when trying to execute a query that uses the character %
. It doesn't happen with 1.0.8 or 1.0.9 but does with 1.1.0 :
$ pip freeze|grep PyAthenaJDBC
PyAthenaJDBC==1.1.0
Exception when trying to execute query sql_with_percent
Traceback (most recent call last):
File "test.py", line 97, in <module>
raise e
ValueError: unsupported format character 'p' (0x70) at index 457
Hello aughingman7743,
First of all, awesome work you have here! Your implementation is quite handy.
I was looking for upgrading the version from 1 to 2 due to the new driver released by AWS and I noticed that the queries' execution information was lost (e.g. data_scanned_in_bytes).
I was looking into the code to try to hack this information since it is relevant to me, although without any success. Also, I tried to look for the query id to fetch the execution properties offline as work around.
Q1: Therefore, my question is if this is a limitation from the Driver itself ?
Your help is highly appreciated!
Moreover, I noticed that your PyAthena implementation has the information I am looking for since you use the athena api. Do you have any benchmark or concern regarding the utilization on the latter vs the former (PyAthenaJDBC).
Up to know I ran a simple test "select * from mytable limit 1000" and consistently, the PyAthenaJDBC has better performance over PyAthena with the simple cursor or pandas cursor.
Q2: Did you find the same results?
Cheers!
Thanks in advance
There is this already closed issue #9, created and solved in 2017.
It is about get query ID from cursor, and at that time there was a property cursor.query_id
that solved this issue. But this property was removed from the PyAthenaJDBC code in 2018 (in this commit 8d9b5de#diff-d6a2ffe1ed91aa544f98e96db3d239ca)
So, my issue is pretty the same as his :) There is a way to get the query ID in cursor?
Hello,
I have been using PyAthenaJDBC successfully and I would like to thank you for your efforts
Nevertheless, I have been facing some persistent issue. I keep getting this java error whenever I use the Athena connection twice in a row.
As a matter of fact, I was able to connect to Athena, show databases, create new tables and even query the content. I am building an application using Django and running its server to use Athena
However, I am obliged to re-run the server in order for the Athena connection to work once again,
Here is a glimpse at the class I have built (Note that I am using a local .jar file: I thought that would resolve the issue but I was wrong)
import os
import configparser
import pyathenajdbc
#Get aws credentials for the moment
aws_config_file = '~/.aws/config'
Config = configparser.ConfigParser()
Config.read(os.path.expanduser(aws_config_file))
access_key_id = Config['default']['aws_access_key_id']
secret_key_id = Config['default']['aws_secret_access_key']
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
athena_jdbc_driver_path = BASE_DIR + "/lib/static/AthenaJDBC.jar"
log_path = BASE_DIR + "/lib/static/queries.log"
class PyAthenaLoader():
def __init__(self):
pyathenajdbc.ATHENA_JAR = athena_jdbc_driver_path
def connecti(self):
self.conn = pyathenajdbc.connect(
s3_staging_dir="s3://aws-athena-query-results--us-west-2",
access_key=access_key_id,
secret_key=secret_key_id,
#profile_name = "default",
#credential_file = aws_config_file,
region_name="us-west-2",
log_path=log_path,
driver_path=athena_jdbc_driver_path
)
def databases(self):
dbs = self.query("show databases;")
return dbs
def tables(self, database):
tables = self.query("show tables in {0};".format(database))
return tables
def create(self):
self.connecti()
try:
with self.conn.cursor() as cursor:
cursor.execute(
"""CREATE EXTERNAL TABLE IF NOT EXISTS sales4 (
Day_ID date,
Product_Id string,
Store_Id string,
Sales_Units int,
Sales_Cost float,
Currency string
)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
WITH SERDEPROPERTIES (
'serialization.format' = '|',
'field.delim' = '|',
'collection.delimm' = 'undefined',
'mapkey.delim' = 'undefined'
) LOCATION 's3://athena-internship/';
""")
res = cursor.description
finally:
self.conn.close()
return res
def query(self, req):
self.connecti()
try:
with self.conn.cursor() as cursor:
cursor.execute(req)
print(cursor.description)
res = cursor.fetchall()
finally:
self.conn.close()
return res
def info(self):
res = []
for i in dir(pyathenajdbc):
temp = i + ' = ' + str(dic[i])
#print(temp)
res.append(temp)
return res
Example of usage :
athena = jdbc.PyAthenaLoader() res = athena.query('Select * from sales;')
Works just fine!
However refreshing the page would cause this error :
Any help? If other details are missing I will provide them immediately
Thanks,
We use temporary credentials for accessing AWS resources, and this library doesn't seem to work when you use the profile_name
parameter.
aws_session_token
set)$ cat ~/.aws/credentials
[my-profile]
region = eu-west-1
aws_access_key_id = ...
aws_secret_access_key = ...
aws_session_token = ...
def get_connection():
return connect(
profile_name="my-profile",
s3_staging_dir='s3://bucket/foo',
region_name=Session().region_name,
log_path='/tmp/log.txt'
)
Just get the following error
com.amazonaws.athena.jdbc.shaded.com.amazonaws.SdkClientExceptionPyRaisable: com.amazonaws.athena.jdbc.shaded.com.amazonaws.SdkClientException: Unable to load AWS credentials from any provider in the chain
I think this is because of this line
https://github.com/laughingman7743/PyAthenaJDBC/blob/master/pyathenajdbc/connection.py#L108
As the token
is set, it sets the class name to DefaultAWSCredentialsProvider
which is fine, but it doesn't look like it passes the profile name (my-profile
) anywhere.
To prove this, I changed the profile name in my ~/.aws/credentials
file to just default
(and changed profile_name
to default
too) and everything worked.
Maybe a fix could be to use ProfileCredentialsProvider
if profile_name
is set and then pass the profile_name as a parameter?
GLOB sdist-make: /home/travis/build/laughingman7743/PyAthenaJDBC/setup.py
py26 create: /home/travis/build/laughingman7743/PyAthenaJDBC/.tox/py26
py26 installdeps: unittest2, futures, SQLAlchemy>=1.0.0, pytest, pytest-cov, pytest-catchlog
py26 inst: /home/travis/build/laughingman7743/PyAthenaJDBC/.tox/dist/PyAthenaJDBC-1.2.0.zip
ERROR: invocation failed (exit code 1), logfile: /home/travis/build/laughingman7743/PyAthenaJDBC/.tox/py26/log/py26-2.log
ERROR: actionid: py26
msg: installpkg
cmdargs: ['/home/travis/build/laughingman7743/PyAthenaJDBC/.tox/py26/bin/pip', 'install', '/home/travis/build/laughingman7743/PyAthenaJDBC/.tox/dist/PyAthenaJDBC-1.2.0.zip']
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
Processing ./.tox/dist/PyAthenaJDBC-1.2.0.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-4wbz7u-build/setup.py", line 76, in <module>
from wheel.bdist_wheel import bdist_wheel
File "/home/travis/build/laughingman7743/PyAthenaJDBC/.tox/py26/lib/python2.6/site-packages/wheel/bdist_wheel.py", line 407
ignore=lambda x, y: {'PKG-INFO', 'requires.txt', 'SOURCES.txt',
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-4wbz7u-build/
py26 installed: DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6,argparse==1.4.0,coverage==4.4.1,futures==3.1.1,linecache2==1.0.0,ordereddict==1.1,py==1.4.34,pytest==3.2.2,pytest-catchlog==1.2.2,pytest-cov==2.5.1,six==1.10.0,SQLAlchemy==1.1.14,traceback2==1.4.0,unittest2==1.1.0
___________________________________ summary ____________________________________
ERROR: py26: InvocationError: /home/travis/build/laughingman7743/PyAthenaJDBC/.tox/py26/bin/pip install /home/travis/build/laughingman7743/PyAthenaJDBC/.tox/dist/PyAthenaJDBC-1.2.0.zip (see /home/travis/build/laughingman7743/PyAthenaJDBC/.tox/py26/log/py26-2.log)
Hi,
Is it possible to read a column whose type is array<struct< ... >> ? I can't do this only by JDBC.
Thanks.
Due to the abandonment of JayDeBeAPI by its author and it being an endless source of headaches as the accepted answer on stackoverflow to it not working is "pin JPype to 0.6.3", I am pursuing incorporating a dbapi2 compliment wrapper into JPype. I want to make sure that it doesn't blatantly conflict with the goals of this project. When complete the JPype version will hopefully work with any JDBC driver including Athena so there is some overlap in coverage between our version and this project.
If you have a moment to go over how to resolve any conflicts or if you are interested in participating in the direction of the JPype effort, please respond to this post or join the discussion at jpype-project/jpype#744. Thanks.
Running a (broken) query on v1.1.1:
ERROR Failed to execute query.
Traceback (most recent call last):
File ".../pyathenajdbc/cursor.py", line 117, in execute
result_set = self._statement.executeQuery(query)
jpype._jexception.java.sql.SQLExceptionPyRaisable: java.sql.SQLException: Failed to run query
ERROR line 89:22: mismatched input 'IN' expecting {')', 'GROUP', 'ORDER', 'HAVING', 'LIMIT', 'OR', 'AND', 'UNION', 'EXCEPT', 'INTERSECT'} (Service: AmazonAthena; Status Code: 400; Error Code: InvalidRequestException; Request ID: 14660a88-118e-11e8-b0e3-6d7bda9bea82)
However with v1.3.1 those really handy details seem lost:
ERROR Failed to execute query.
Traceback (most recent call last):
File ".../pyathenajdbc/cursor.py", line 172, in execute
result_set = self._statement.executeQuery(query)
jpype._jexception.java.sql.SQLExceptionPyRaisable: java.sql.SQLException: Failed to run query
ERROR java.sql.SQLException: Failed to run query
I think this is the change that changed this:
c253586
I've tried to workaround this by putting that logic in my code but it looks like the data is lost (presumably as the exception is reraised)
Hi,
I am running into this error after running several big queries and reusing the connection:
jpype._jexception.OutOfMemoryErrorPyRaisable: java.lang.OutOfMemoryError: GC overhead limit exceeded
Any ideas? Any way to pass the JVM args to JPype to increase the mem given to the JVM on start?
Thanks!
I'm trying to connect to Athena using pyathenajdbc.connect(). I have AWS credentials setup via Multi-factor Authentication.
I'm making connecting using following: -
athena_conn = connect(access_key=AWS_KEY_ID, secret_key=AWS_SECRET, s3_staging_dir='s3://abc-pqr-xyz/processed/athena-outputs/',region_name=REGION)
athena_conn = connect(access_key=AWS_KEY_ID, secret_key=AWS_SECRET, token=AWS_SESSION_TOKEN, s3_staging_dir='s3://abc-pqr-xyz/processed/athena-outputs/',region_name=REGION)
In both cases I get following error:
ERROR: _pyathenajdbc.error.DatabaseError: The security token included in the request is invalid. (Service: AmazonAthena; Status Code: 400; Error Code: UnrecognizedClientException; Request ID: 91751051-1eed-11e7-8347-153dfe3d84a6)
I'm using boto3.Session to get AWS credentials from aws/credentials file. These credentials are setup using MFA authentication. It seems PyAthenaJDBC package does not support session_token for creating the boto session connection. Can we modify this package to implement missing feature?
from pyathenajdbc import connect
from pyathenajdbc.util import as_pandas
from boto3 import Session
import jpype
jvm_path = jpype.getDefaultJVMPath()
_current_credentials = Session().get_credentials()
AWS_KEY_ID = _current_credentials.access_key
AWS_SECRET = _current_credentials.secret_key
AWS_SESSION_TOKEN = _current_credentials.token
REGION = "us-east-2"
#athena_conn = connect(access_key=AWS_KEY_ID, secret_key=AWS_SECRET, s3_staging_dir='s3://abc-pqr-xyz/processed/athena-outputs/',region_name=REGION)
athena_conn = connect(access_key=AWS_KEY_ID, secret_key=AWS_SECRET, token=AWS_SESSION_TOKEN, s3_staging_dir='s3://abc-pqr-xyz/processed/athena-outputs/',region_name=REGION)
cursor = athena_conn.cursor();
query = 'SELECT * FROM xyz.ABC limit 1;'
cursor.execute(query)
df = as_pandas(cursor)
print(df)
Thank you,
Sonal Shirke
I think the code here needs to be restructured:
PyAthenaJDBC/pyathenajdbc/connection.py
Lines 151 to 174 in e06196b
DefaultAWSCredentialsProviderChain
covers access via credentials file, profile name, or token, so it should be the default option. I don't think we need all these code branches checking for each case and setting a different provider. The default provider takes care of all of that automatically.
If the PyAthenaJDBC API requires it, perhaps the only branch we need is to check if the user explicitly passed in credentials to connect()
. And if not, it should just defer to DefaultAWSCredentialsProviderChain
. Does that make sense?
Another thing that seems off in this block of code is that it doesn't seem to respect the user-provided AwsCredentialsProviderClass
. If I specify that in the URL parameters, it gets overridden by this code.
So, for example, I am connecting to Athena via PyAthenaJDBC and SQLAlchemy. I tried manually setting AwsCredentialsProviderClass
in the URL as follows:
jdbc:awsathena://athena.us-east-1.amazonaws.com:443;AwsCredentialsProviderClass=com.simba.athena.amazonaws.auth.DefaultAWSCredentialsProviderChain
But because I've also set AWS_PROFILE
, something gets messed up and I get this error:
E jpype._jclass.java.sql.SQLException: [Simba][AthenaJDBC](100191) Failed to create
AWS Credentials Provider class: com.simba.athena.amazonaws.auth.DefaultAWSCredentialsProviderChain.
If I just delete that entire block of code from _build_driver_args()
, everything works. Specifically, I can query Athena using the temporary credentials associated with the configured AWS profile.
If this all makes sense, I'd be happy to submit a PR to fix this behavior, including the appropriate tests.
Last week Amazon released an updated driver that brings significant performance improvements: https://docs.aws.amazon.com/athena/latest/ug/release-note-2018-08-16.html
It would be useful to update PyAthenaJDBC to include this driver so I can reap the benefits in my application (alternatively, include an interface to manually download/select the new driver - unless there already is and I've missed it).
便利なライブラリありがとうございます。
READMEのUsageにある下記コードを実行したところ、私の環境では下記エラーが発生しました。
from pyathenajdbc import connect
conn = connect(s3_staging_dir='s3://aws-athena-query-results-hoge-us-east-1/')
try:
with conn.cursor() as cursor:
cursor.execute("""
SELECT * FROM test_pyathena_jdbc.one_row
""")
print(cursor.description)
print(cursor.fetchall())
finally:
conn.close()
エラー内容は
File "handler.py", line 121, in <module> conn = connect(s3_staging_dir='s3://aws-athena-query-results-hoge-us-east-1/') File "/shared/lib/pyathenajdbc/__init__.py", line 65, in connect **kwargs) File "/shared/lib/pyathenajdbc/connection.py", line 69, in __init__ jpype.JClass(ATHENA_DRIVER_CLASS_NAME) File "/shared/lib/jpype/_jclass.py", line 55, in JClass raise _RUNTIMEEXCEPTION.PYEXC("Class %s not found" % name) jpype._jexception.RuntimeExceptionPyRaisable: java.lang.RuntimeException: Class com.amazonaws.athena.jdbc.AthenaDriver not found
といったもので、AWS提供のJDBCライブラリjarのクラス読み込みでエラーが発生しています。
jpype.JClassをjava.lang.Stringなどを引数に呼び出すとエラーは置きないのでJarの読み込みに失敗しているようです。
JPypeが原因のようなのですが調べても特に解決策が見当たらず、、、
実行環境は
Mac上のDockerコンテナ(Amazon Linux)
Java OpenJDK 1.7.0_121
Python 2.7.12
なのですが、他に実行環境で満たしておくべき条件などありますでしょうか。
Hello
This is just a request for help, not an issue per se.
I tried installing PyAthena on Windows 10.
First error was that VC++ compiler 14.0 was required.
This is rather odd but ok, so I installed VC++ compiler, since I have a VS 2017 license.
Now CL.exe exists, I verified it.
Then I repeated the pip installation and got a different error, log is below.
Can anyone suggest next steps?
Also, as this tool is meant to work on Linux also, so what is the C++ requirement on Linux?
Is there a doc which tells me what prerequisites I need installed for PyAthena to work on Windows and on Linux ?
I tried running pip install from VS 2017 developer command shell, it still did not work.
I am guessing some environmental variables are not set up, but given I dont know anything about VC++, I dont know what pip needs to work.
It would help if all non-python dependency installation steps were documented because this product is aimed for Python developers, not for C++ developers, and should cover Windows and Linux.
Thank you very much in advance.
The Log of failed installation (Windows 10, VS 2017 Professional is installed, using Python 3.7):
U:>pip install PyAthenaJDBC
Collecting PyAthenaJDBC
Using cached https://files.pythonhosted.org/packages/b8/45/017b913c925f812a3d7217b0783bf8e65a4cc9d2624134119d29067034e5/PyAthenaJDBC-2.0.1-py2.py3-none-any.whl
Requirement already satisfied: botocore>=1.0.0 in c:\python3\lib\site-packages (from PyAthenaJDBC) (1.12.67)
Collecting jpype1>=0.6.0 (from PyAthenaJDBC)
Using cached https://files.pythonhosted.org/packages/c4/4b/60a3e63d51714d4d7ef1b1efdf84315d118a0a80a5b085bb52a7e2428cdc/JPype1-0.6.3.tar.gz
Requirement already satisfied: future in c:\python3\lib\site-packages (from PyAthenaJDBC) (0.17.1)
Requirement already satisfied: docutils>=0.10 in c:\python3\lib\site-packages (from botocore>=1.0.0->PyAthenaJDBC) (0.14)
Requirement already satisfied: urllib3<1.25,>=1.20; python_version >= "3.4" in c:\python3\lib\site-packages (from botocore>=1.0.0->PyAthenaJDBC) (1.24.1)
Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in c:\python3\lib\site-packages (from botocore>=1.0.0->PyAthenaJDBC) (0.9.3)
Requirement already satisfied: python-dateutil<3.0.0,>=2.1; python_version >= "2.7" in c:\python3\lib\site-packages (from botocore>=1.0.0->PyAthenaJDBC) (2.7.5)
Requirement already satisfied: six>=1.5 in c:\python3\lib\site-packages (from python-dateutil<3.0.0,>=2.1; python_version >= "2.7"->botocore>=1.0.0->PyAthenaJDBC) (1.12.0)
Installing collected packages: jpype1, PyAthenaJDBC
Running setup.py install for jpype1 ... error
Complete output from command c:\python3\python.exe -u -c "import setuptools, tokenize;file='C:\Users\YURI1.BUD\AppData\Local\Temp\pip-install-krg67r7j\jpype1\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\YURI1.BUD\AppData\Local\Temp\pip-record-7gn72az2\install-record.txt --single-version-externally-managed --compile:
Found native jni.h at c:\java\java8\include
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\jpype
copying jpype\imports.py -> build\lib.win-amd64-3.7\jpype
copying jpype\JClassUtil.py -> build\lib.win-amd64-3.7\jpype
copying jpype\nio.py -> build\lib.win-amd64-3.7\jpype
copying jpype\reflect.py -> build\lib.win-amd64-3.7\jpype
copying jpype_classpath.py -> build\lib.win-amd64-3.7\jpype
copying jpype_core.py -> build\lib.win-amd64-3.7\jpype
copying jpype_cygwin.py -> build\lib.win-amd64-3.7\jpype
copying jpype_darwin.py -> build\lib.win-amd64-3.7\jpype
copying jpype_gui.py -> build\lib.win-amd64-3.7\jpype
copying jpype_jarray.py -> build\lib.win-amd64-3.7\jpype
copying jpype_jboxed.py -> build\lib.win-amd64-3.7\jpype
copying jpype_jclass.py -> build\lib.win-amd64-3.7\jpype
copying jpype_jcollection.py -> build\lib.win-amd64-3.7\jpype
copying jpype_jexception.py -> build\lib.win-amd64-3.7\jpype
copying jpype_jio.py -> build\lib.win-amd64-3.7\jpype
copying jpype_jobject.py -> build\lib.win-amd64-3.7\jpype
copying jpype_jpackage.py -> build\lib.win-amd64-3.7\jpype
copying jpype_jproxy.py -> build\lib.win-amd64-3.7\jpype
copying jpype_jvmfinder.py -> build\lib.win-amd64-3.7\jpype
copying jpype_jwrapper.py -> build\lib.win-amd64-3.7\jpype
copying jpype_linux.py -> build\lib.win-amd64-3.7\jpype
copying jpype_properties.py -> build\lib.win-amd64-3.7\jpype
copying jpype_pykeywords.py -> build\lib.win-amd64-3.7\jpype
copying jpype_refdaemon.py -> build\lib.win-amd64-3.7\jpype
copying jpype_windows.py -> build\lib.win-amd64-3.7\jpype
copying jpype_init_.py -> build\lib.win-amd64-3.7\jpype
creating build\lib.win-amd64-3.7\jpype\awt
copying jpype\awt_init_.py -> build\lib.win-amd64-3.7\jpype\awt
creating build\lib.win-amd64-3.7\jpype\awt\event
copying jpype\awt\event\WindowAdapter.py -> build\lib.win-amd64-3.7\jpype\awt\event
copying jpype\awt\event_init_.py -> build\lib.win-amd64-3.7\jpype\awt\event
creating build\lib.win-amd64-3.7\jpypex
copying jpypex_init_.py -> build\lib.win-amd64-3.7\jpypex
creating build\lib.win-amd64-3.7\jpypex\swing
copying jpypex\swing\AbstractAction.py -> build\lib.win-amd64-3.7\jpypex\swing
copying jpypex\swing\pyutils.py -> build\lib.win-amd64-3.7\jpypex\swing
copying jpypex\swing_init_.py -> build\lib.win-amd64-3.7\jpypex\swing
running build_ext
building '_jpype' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\native
creating build\temp.win-amd64-3.7\Release\native\common
creating build\temp.win-amd64-3.7\Release\native\python
cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DWIN32=1 -Inative\common\include -Inative\python\include -Ic:\java\java8\include -Ic:\java\java8\include\win32 -Ic:\python3\include -Ic:\python3\include "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\cppwinrt" /EHsc /Tpnative\common\jp_array.cpp /Fobuild\temp.win-amd64-3.7\Release\native\common\jp_array.obj /EHsc
error: command 'cl.exe' failed: No such file or directory
----------------------------------------
Command "c:\python3\python.exe -u -c "import setuptools, tokenize;file='C:\Users\YURI1.BUD\AppData\Local\Temp\pip-install-krg67r7j\jpype1\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\YURI1.BUD\AppData\Local\Temp\pip-record-7gn72az2\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\YURI~1.BUD\AppData\Local\Temp\pip-install-krg67r7j\jpype1\
When I install from pip (reproduced on macOS Sierra and Ubuntu 14.04, running both Python 2 and 3) using the command pip install PyAthenaJDBC[SQLAlchemy]
, I get the error message Ignoring SQLAlchemy: markers 'extra == "SQLAlchemy"' don't match your environment
.
However, when I clone the repository, then install using pip install ./PyAthenaJDBC[SQLAlchemy]
, the installation works.
Hey @laughingman7743, it's @mrshu again!
As I said in laughingman7743/PyAthena#63, thanks a ton for putting together these two wrapper packages!
I have just a very small beef with PyAthenaJDBC
-- aside from slowness mostly caused by necessity of running JVM, it takes nearly forever to get columns using SQLAlchemy in the setup I am using. After digging a bit deeper, I found that this is actually by design, and that the get_columns
method starts with the following comment.
# information_schema.columns fails when filtering with table_schema or table_name
# when specifying a name that does not exist in table_schema or table_name.
I went ahead to test it out and can report that the following query
SELECT
table_schema,
table_name,
column_name,
data_type,
is_nullable,
column_default,
ordinal_position,
comment
FROM information_schema.columns
WHERE
table_schema = 'non_existent_schema'
AND table_name = 'non_existent_table'
does not fail but returns zero rows. I am not sure if something changed since when the get_columns
query has been introduced in #14, but I was wondering whether you would be up for making it a bit more efficient?
Once again, I am happy to put together a PR that does this, I'd just like to make sure it fits into your perspective on what should PyAthenaJDBC
look like as well.
Thanks again!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.