question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

KeyError: 'StatementType' with Athena using max_cache_seconds

See original GitHub issue

Describe the bug I’m trying to execute a query against AWS Athena -

pricing_table = awswrangler.athena.read_sql_query(
        (
            "SELECT * FROM historical_lane_pricing "
            "WHERE postal_code in ({}) "
            "AND company_id = '{}'"
        ).format(
            ', '.join(["'{}'".format(stop_zip) for stop_zip in stops_zips]),
            pricing_request.company_id,
        ),
        database = "default",
        max_cache_seconds=900,
        max_cache_query_inspections=500
    )

Which is producing the falling terror -

KeyError: 'StatementType'

To Reproduce This doesn’t happen against master branch, only with PyPI installed v 1.6.3

Run a query against AWS Athena using the read_sql_query method and setting a value > 0 for the max_cache_seconds argument.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
igorborgestcommented, Jul 17, 2020

Awesome @zacharycarter, thank you for test it.

1reaction
zacharycartercommented, Jul 16, 2020

Hi @igorborgest - please accept my apologies for not getting back to you on boto3 / botocore versions, and thank you for reproducing and addressing this so quickly! We had a hackathon going on at work today so I was preoccupied with that.

I will test this tomorrow against the dev branch and confirm that everything is working for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

'StatementType' with Athena using max_cache_seconds ...
Describe the bug I'm trying to execute a query against AWS Athena ... KeyError: 'StatementType' with Athena using max_cache_seconds #323.
Read more >
Troubleshooting in Athena - AWS Documentation
The Athena team has gathered the following troubleshooting information from customer issues. Although not comprehensive, it includes advice regarding some ...
Read more >
Athena — Boto3 Docs 1.26.33 documentation - AWS
Amazon Athena is an interactive query service that lets you use standard SQL to analyze data directly in Amazon S3. You can point...
Read more >
How to Create Dataframe from AWS Athena using Boto3 ...
get_query_results only returns 1000 rows. How can I use it to get two million rows into a Pandas dataframe? If you try to...
Read more >
Amazon Athena - Tableau Help
Make the connection and set up the data source · Enter the name of the server. · Enter the name of the S3...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found