Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allowing to specify a custom work group for AWS Athena queries #3592

Merged
merged 2 commits into from
Mar 27, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions redash/query_runner/athena.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ def configuration_schema(cls):
'type': 'boolean',
'title': 'Use Glue Data Catalog',
},
'work_group': {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add this to the correct place in order? (it happens now automatically due to the alphabetical order, but who knows what will come next)

'type': 'string',
'title': 'Athena work group',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'title': 'Athena work group',
'title': 'Athena Work Group',

'default': 'primary'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be safer/more backward compatible to just not pass anything if no value provided?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the AWS documentation:

By default, each account has a primary workgroup and the default permissions allow all authenticated users access to this workgroup. The primary workgroup cannot be deleted.

},
},
'required': ['region', 's3_staging_dir'],
'order': ['region', 'aws_access_key', 'aws_secret_key', 's3_staging_dir', 'schema'],
Expand Down Expand Up @@ -170,6 +175,7 @@ def run_query(self, query, user):
schema_name=self.configuration.get('schema', 'default'),
encryption_option=self.configuration.get('encryption_option', None),
kms_key=self.configuration.get('kms_key', None),
work_group=self.configuration.get('work_group', 'primary'),
formatter=SimpleFormatter()).cursor()

try:
Expand Down
6 changes: 3 additions & 3 deletions requirements_all_ds.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ td-client==0.8.0
pymssql==2.1.3
dql==0.5.24
dynamo3==0.4.7
boto3==1.9.85
botocore==1.12.85
boto3==1.9.115
botocore==1.12.115
sasl>=0.1.3
thrift>=0.8.0
thrift_sasl>=0.1.0
cassandra-driver==3.11.0
memsql==2.16.0
atsd_client==2.0.12
simple_salesforce==0.72.2
PyAthena>=1.0.0
PyAthena>=1.5.0
pymapd==0.7.1
qds-sdk>=1.9.6
ibm-db>=2.0.9
Expand Down