Skip to content

remove region #1085

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 0 additions & 8 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ declare module 'snowflake-sdk' {
ERR_CONN_CREATE_INVALID_STREAM_RESULT = 404019,
ERR_CONN_CREATE_INVALID_FETCH_AS_STRING = 404020,
ERR_CONN_CREATE_INVALID_FETCH_AS_STRING_VALUES = 404021,
ERR_CONN_CREATE_INVALID_REGION = 404022,
ERR_CONN_CREATE_INVALID_KEEP_ALIVE = 404023,
ERR_CONN_CREATE_INVALID_KEEP_ALIVE_HEARTBEAT_FREQ = 404024,
ERR_CONN_CREATE_INVALID_TREAT_INTEGER_AS_BIGINT = 404025,
Expand All @@ -75,7 +74,6 @@ declare module 'snowflake-sdk' {
ERR_CONN_CREATE_INVALID_CLIENT_CONFIG_FILE = 404043,
ERR_CONN_CREATE_INVALID_RETRY_TIMEOUT = 404044,
ERR_CONN_CREATE_INVALID_ACCOUNT_REGEX = 404045,
ERR_CONN_CREATE_INVALID_REGION_REGEX = 404046,
ERR_CONN_CREATE_INVALID_DISABLE_CONSOLE_LOGIN = 404047,
ERR_CONN_CREATE_INVALID_FORCE_GCP_USE_DOWNSCOPED_CREDENTIAL = 404048,
ERR_CONN_CREATE_INVALID_REPRESENT_NULL_AS_STRING_NULL = 404050,
Expand Down Expand Up @@ -265,12 +263,6 @@ declare module 'snowflake-sdk' {
*/
application?: string;

/**
* @deprecated
* The ID for the region where your account is located.
*/
region?: string;

/**
* Host address to which the driver should connect.
*/
Expand Down
10 changes: 0 additions & 10 deletions lib/connection/connection_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,6 @@ function consolidateHostAndAccount(options) {
const protocol = options.protocol || 'https';
const port = Util.exists(options.port) ? Util.format(':%s', options.port) : '';


if (Util.exists(options.region)) {
Errors.checkArgumentValid(Util.isCorrectSubdomain(options.region), ErrorCodes.ERR_CONN_CREATE_INVALID_REGION_REGEX);
realRegion = options.region;
}

if (Util.exists(options.account)) {
Errors.checkArgumentValid(Util.isString(options.account), ErrorCodes.ERR_CONN_CREATE_INVALID_ACCOUNT);
Errors.checkArgumentValid(Util.isCorrectSubdomain(options.account), ErrorCodes.ERR_CONN_CREATE_INVALID_ACCOUNT_REGEX);
Expand Down Expand Up @@ -124,9 +118,6 @@ function consolidateHostAndAccount(options) {
realAccount = options.account;
}
} else if (Util.exists(options.account)) { //only account() is set in configuration
if (options.region === 'us-west-2') {
options.region = '';
}
options.host = Util.constructHostname(realRegion, realAccount);
options.accessUrl = Util.format('%s://%s%s', protocol, options.host, port);
}
Expand Down Expand Up @@ -977,7 +968,6 @@ function ConnectionConfig(options, validateCredentials, qaMode, clientInfo) {
this.username = options.username;
this.password = options.password;
this.accessUrl = options.accessUrl;
this.region = options.region;
this.account = options.account;
this.host = options.host;
this.sessionToken = options.sessionToken;
Expand Down
2 changes: 0 additions & 2 deletions lib/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ codes.ERR_CONN_CREATE_INVALID_PROXY_PORT = 404018;
codes.ERR_CONN_CREATE_INVALID_STREAM_RESULT = 404019;
codes.ERR_CONN_CREATE_INVALID_FETCH_AS_STRING = 404020;
codes.ERR_CONN_CREATE_INVALID_FETCH_AS_STRING_VALUES = 404021;
codes.ERR_CONN_CREATE_INVALID_REGION = 404022;
codes.ERR_CONN_CREATE_INVALID_KEEP_ALIVE = 404023;
codes.ERR_CONN_CREATE_INVALID_KEEP_ALIVE_HEARTBEAT_FREQ = 404024;
codes.ERR_CONN_CREATE_INVALID_TREAT_INTEGER_AS_BIGINT = 404025;
Expand All @@ -73,7 +72,6 @@ codes.ERR_CONN_CREATE_INVALID_INCLUDE_RETRY_REASON = 404042;
codes.ERR_CONN_CREATE_INVALID_CLIENT_CONFIG_FILE = 404043;
codes.ERR_CONN_CREATE_INVALID_RETRY_TIMEOUT = 404044;
codes.ERR_CONN_CREATE_INVALID_ACCOUNT_REGEX = 404045;
codes.ERR_CONN_CREATE_INVALID_REGION_REGEX = 404046;
codes.ERR_CONN_CREATE_INVALID_DISABLE_CONSOLE_LOGIN = 404047;
codes.ERR_CONN_CREATE_INVALID_FORCE_GCP_USE_DOWNSCOPED_CREDENTIAL = 404048;
codes.ERR_CONN_CREATE_INVALID_CLIENT_STORE_TEMPORARY_CREDENTIAL = 404049;
Expand Down
55 changes: 0 additions & 55 deletions test/unit/connection/connection_config_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,61 +307,6 @@ describe('ConnectionConfig: basic', function () {
},
errorCode: ErrorCodes.ERR_CONN_CREATE_INVALID_ACCOUNT_REGEX
},
{
name: 'region starting with -',
options:
{
username: 'username',
password: 'password',
account: 'account',
region: '-region'
},
errorCode: ErrorCodes.ERR_CONN_CREATE_INVALID_REGION_REGEX
},
{
name: 'region ending with -',
options:
{
username: 'username',
password: 'password',
account: 'account',
region: 'region-'
},
errorCode: ErrorCodes.ERR_CONN_CREATE_INVALID_REGION_REGEX
},
{
name: 'region starting with invalid character',
options:
{
username: 'username',
password: 'password',
account: 'account',
region: '?region'
},
errorCode: ErrorCodes.ERR_CONN_CREATE_INVALID_REGION_REGEX
},
{
name: 'region with invalid character',
options:
{
username: 'username',
password: 'password',
account: 'account',
region: 'region?'
},
errorCode: ErrorCodes.ERR_CONN_CREATE_INVALID_REGION_REGEX
},
{
name: 'region with invalid character in the middle',
options:
{
username: 'username',
password: 'password',
account: 'account',
region: 'reg?ion'
},
errorCode: ErrorCodes.ERR_CONN_CREATE_INVALID_REGION_REGEX
},
{
name: 'invalid warehouse',
options:
Expand Down
Loading