Goal of this PR: we have better error messages for Athena API.
AC:
We always return pandas DataFrame if no filename is defined (even when errors occur)
We always return None if filename is defined (even when errors occur)
Printed messages are actionable
Use case for which wrong message was raised:
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''')
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:
We plan to add debug mode for all API connectors. If enabled Errors will be raised.
Goal of this PR: we have better error messages for Athena API.
AC:
Use case for which wrong message was raised:
TODO in future: