laughingman7743 / PyAthena

PyAthena is a Python DB API 2.0 (PEP 249) client for Amazon Athena.
MIT License
464 stars 105 forks source link

Athena Reuse Query Results #479

Closed CandiedCode closed 1 year ago

CandiedCode commented 1 year ago

after the merge for passing in the reuse args, boto is currently throwing the following exception


engine = create_engine(conn_str.format(
Failed to execute query.
Traceback (most recent call last):
  File "/Users/jcwagenberg/miniconda3/envs/test/lib/python3.9/site-packages/pyathena/common.py", line 522, in _execute
    query_id = retry_api_call(
  File "/Users/jcwagenberg/miniconda3/envs/test/lib/python3.9/site-packages/pyathena/util.py", line 85, in retry_api_call
    return retry(func, *args, **kwargs)
  File "/Users/jcwagenberg/miniconda3/envs/test/lib/python3.9/site-packages/tenacity/__init__.py", line 379, in __call__
    do = self.iter(retry_state=retry_state)
  File "/Users/jcwagenberg/miniconda3/envs/test/lib/python3.9/site-packages/tenacity/__init__.py", line 314, in iter
    return fut.result()
  File "/Users/jcwagenberg/miniconda3/envs/test/lib/python3.9/concurrent/futures/_base.py", line 439, in result
    return self.__get_result()
  File "/Users/jcwagenberg/miniconda3/envs/test/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result
    raise self._exception
  File "/Users/jcwagenberg/miniconda3/envs/test/lib/python3.9/site-packages/tenacity/__init__.py", line 382, in __call__
    result = fn(*args, **kwargs)
  File "/Users/jcwagenberg/miniconda3/envs/test/lib/python3.9/site-packages/botocore/client.py", line 514, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/Users/jcwagenberg/miniconda3/envs/test/lib/python3.9/site-packages/botocore/client.py", line 901, in _make_api_call
    request_dict = self._convert_to_request_dict(
  File "/Users/jcwagenberg/miniconda3/envs/test/lib/python3.9/site-packages/botocore/client.py", line 962, in _convert_to_request_dict
    request_dict = self._serializer.serialize_to_request(
  File "/Users/jcwagenberg/miniconda3/envs/test/lib/python3.9/site-packages/botocore/validate.py", line 381, in serialize_to_request
    raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Unknown parameter in input: "ResultReuseConfiguration", must be one of: QueryString, ClientRequestToken, QueryExecutionContext, ResultConfiguration, WorkGroup, ExecutionParameters
CandiedCode commented 1 year ago

^ if anyone else gets this... check if you are on a old botocore depdencies. Updating to the newer resolved this issue.

laughingman7743 commented 1 year ago

https://github.com/boto/boto3/blob/develop/CHANGELOG.rst#1264 https://github.com/boto/boto3/blob/1.26.4/setup.cfg#L6

api-change:athena: [botocore] Adds support for using Query Result Reuse

https://github.com/laughingman7743/PyAthena/blob/master/pyproject.toml#L33-L34