{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "[](https://github.com/aws/aws-sdk-pandas)\n", "\n", "# 24 - Athena Query Metadata\n", "\n", "For `wr.athena.read_sql_query()` and `wr.athena.read_sql_table()` the resulting DataFrame (or every DataFrame in the returned Iterator for chunked queries) have a `query_metadata` attribute, which brings the query result metadata returned by Boto3/Athena.\n", "\n", "The expected `query_metadata` format is the same returned by:\n", "\n", "https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/athena.html#Athena.Client.get_query_execution" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Environment Variables" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "env: WR_DATABASE=default\n" ] } ], "source": [ "%env WR_DATABASE=default" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import awswrangler as wr" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | foo | \n", "
---|---|
0 | \n", "1 | \n", "