0

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="...")
4

1 回答 1

0

像这样添加打字提示:

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

应该这样做。

于 2021-11-05T12:07:20.813 回答