cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

How to automate athena queries from S3 With Python and Boto3?

Kaniz
Community Manager
Community Manager
 
1 ACCEPTED SOLUTION

Accepted Solutions

shan_chandra
Honored Contributor III
Honored Contributor III

Please run the below steps in an isolated notebook  to connect to Athena

1. Install boto3 

%sh pip install boto3 

2. check if boto3 library is installed 

%python
import boto3
boto3.__version__

3. Run the below code 

%python 
import boto3
client = boto3.client('athena')

View solution in original post

1 REPLY 1

shan_chandra
Honored Contributor III
Honored Contributor III

Please run the below steps in an isolated notebook  to connect to Athena

1. Install boto3 

%sh pip install boto3 

2. check if boto3 library is installed 

%python
import boto3
boto3.__version__

3. Run the below code 

%python 
import boto3
client = boto3.client('athena')

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.