In the graded assignment for C3_W2, step 18, I’m getting the following error creating the sales_report table. The previous table ‘ratings_for_ml’ was created successfully.
ueryFailed Traceback (most recent call last)
Cell In[20], line 11
1 ctas_query = f"““CREATE TABLE sales_report WITH (
2 table_type = ‘ICEBERG’,
3 location = ‘s3://{BUCKET_NAME}/presentation_zone/sales_report’,
(…)
9 group by year(orderdate), month(orderdate)
10 order by year(orderdate), month(orderdate);””"
—> 11 response = wr.athena.start_query_execution(
12 sql=ctas_query,
13 database=PRESENTATION_DATABASE_NAME,
14 wait=True,
15 s3_output = f’s3://{BUCKET_NAME}/athena_output/sales_report’
16 )
17 print(response[‘Status’][‘State’])
File ~/environment/jupyterlab-venv/lib64/python3.9/site-packages/awswrangler/_config.py:735, in apply_configs..wrapper(*args_raw, **kwargs)
733 del args[name]
734 args = {**args, **keywords}
→ 735 return function(**args)
File ~/environment/jupyterlab-venv/lib64/python3.9/site-packages/awswrangler/athena/_executions.py:163, in start_query_execution(sql, database, s3_output, workgroup, encryption, kms_key, params, paramstyle, boto3_session, client_request_token, athena_cache_settings, athena_query_wait_polling_delay, data_source, wait)
149 query_execution_id = _start_query_execution(
150 sql=sql,
151 wg_config=wg_config,
(…)
160 boto3_session=boto3_session,
161 )
162 if wait:
→ 163 return wait_query(
164 query_execution_id=query_execution_id,
165 boto3_session=boto3_session,
166 athena_query_wait_polling_delay=athena_query_wait_polling_delay,
167 )
169 return query_execution_id
File ~/environment/jupyterlab-venv/lib64/python3.9/site-packages/awswrangler/_config.py:735, in apply_configs..wrapper(*args_raw, **kwargs)
733 del args[name]
734 args = {**args, **keywords}
→ 735 return function(**args)
File ~/environment/jupyterlab-venv/lib64/python3.9/site-packages/awswrangler/athena/_executions.py:236, in wait_query(query_execution_id, boto3_session, athena_query_wait_polling_delay)
234 _logger.debug(“Query state change reason: %s”, response[“Status”].get(“StateChangeReason”))
235 if state == “FAILED”:
→ 236 raise exceptions.QueryFailed(response[“Status”].get(“StateChangeReason”))
237 if state == “CANCELLED”:
238 raise exceptions.QueryCancelled(response[“Status”].get(“StateChangeReason”))
QueryFailed: TABLE_NOT_FOUND: line 11:4: Table ‘awsdatacatalog.curated_zone.orders’ does not exist. You may need to manually clean the data at location ‘s3://de-c3w2a1-992382454081-us-east-1-data-lake/athena_output/sales_report/tables/c3c9ea81-d774-4804-adba-635e912b785f’ before retrying. Athena will not delete data in your account.