I am fairly new to Python, and I am using prestodb to connect to a database to pull data and manipulate it. Everything works fine, except the query results do not have column names.
I saw a post about enabling headers in SQL+, but I am unable to find anything for prestodb. I checked the documentation on GitHub, but I am either not experienced enough or did not find a way to change the results for genall, fetchall, etc.
Does anyone have ideas on how to pull in column names/headers with my query?
Code:
conn = prestodb.dbapi.connect(
host='hostname',
port=4443,
user='username',
catalog='meld',
schema='athena',
http_scheme='https',
auth=prestodb.auth.BasicAuthentication("username", "password"),
)
cur = conn.cursor()
cur.execute('SELECT * FROM meld.athena.athena_business_summary limit 10')
query = cur.genall()
rows = pd.DataFrame(query)
print(rows)