Wikia / sroka

Python library for API access and data analysis in Product, BI, Revenue Operations (GAM, GA, Athena etc.)
MIT License
71 stars 11 forks source link

athena error message fix #25

Closed martynaut closed 4 years ago

martynaut commented 4 years ago

Goal of this PR: we have better error messages for Athena API.

AC:

Use case for which wrong message was raised:

  1. run query similar to one below in a cell (note missing quote on day value)

query = query_athena('''SELECT * FROM table_name WHERE year = '2019' AND month = '09' AND day = '07 limit 10''')

  1. returns: Please check your credentials including s3_bucket in config.ini file

When the same query is run in Athena it throws an error line 3:60: no viable alternative at input '= '' (service: amazonathena; status code: 400; error code: invalidrequestexception; request id: 46d71f5e-ac75-4dab-a474-4c9541774386)

TODO in future:

martynaut commented 4 years ago

Added handling of incorrect input to function as suggested by @dorotamierzwa