From 92c9f84a85b21446ec0bd11664fb3d663ce44187 Mon Sep 17 00:00:00 2001 From: laughingman7743 Date: Fri, 10 Apr 2020 00:47:15 +0900 Subject: [PATCH] Support Beijing region endpoints (fix #97) --- pyathenajdbc/sqlalchemy_athena.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyathenajdbc/sqlalchemy_athena.py b/pyathenajdbc/sqlalchemy_athena.py index 1164224..809dea6 100644 --- a/pyathenajdbc/sqlalchemy_athena.py +++ b/pyathenajdbc/sqlalchemy_athena.py @@ -117,7 +117,7 @@ def create_connect_args(self, url): opts = { 'access_key': url.username if url.username else None, 'secret_key': url.password if url.password else None, - 'region_name': re.sub(r'^athena\.([a-z0-9-]+)\.amazonaws\.com$', r'\1', url.host), + 'region_name': re.sub(r'^athena\.([a-z0-9-]+)\.amazonaws\.(com|com.cn)$', r'\1', url.host), 'schema_name': url.database if url.database else 'default' } opts.update(url.query)