'Visual Studio doesn't show help pop up with DataFrame from awswrangler

I am using VS Code with Microsoft Python extension. If I create a Pandas dataframe and write the name of the variable VS Code popups all kinds of help text. However, if I have a variable made using wr.athena.read_sql_query, I don't get any help text even if the variable is a Pandas dataframe.

Is there a way to make VS Code realize that df2 in the example is a Pandas DataFrame and get the help text?

import boto3
import awswrangler as wr
import pandas as pd

df1 = pd.DataFrame({"a":[1]})
df2 = wr.athena.read_sql_query(sql="...", database="...")


Solution 1:[1]

Adding a typing hint like so:

df2: pd.DataFrame = wr.athena.read_sql_query(sql="...", database="...")

should do it.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Abdel Jaidi