我正在通过AWS wrapper 运行以下代码
import awswrangler as wr
my_query = wr.athena.read_sql_query(
sql="""select "$path" as path from table""",
database='db', workgroup='workgroup'
)
但我不希望使用静态方法,如Aws Cli
或configurations
文件来存储我的信用。
如何在上面的代码中直接添加creds?
我必须创建一个boto3会话并将其作为参数值传递
my_session = boto3.Session(region_name="REGION",
aws_access_key_id="YOUR_ACCESS_KEY", aws_secret_access_key="YOUR_SECRET_ACCESS_KEY")
my_query = wr.athena.read_sql_query(
sql="""select "$path" as path from table""",
database='db', workgroup='workgroup',
boto3_session= my_session
)