Skip to content

Commit d87dc0b

Browse files
SNOW-2129602 Fix GCS staging by ensuring the endpoint has a scheme (#2354)
1 parent b12ba84 commit d87dc0b

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

DESCRIPTION.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ Source code is also available at: https://github.com/snowflakedb/snowflake-conne
1818
- Fixed a bug where timezoned timestamps fetched as pandas.DataFrame or pyarrow.Table would overflow for the sake of unnecessary precision. In the case where an overflow cannot be prevented a clear error will be raised now.
1919
- Fix OAuth authenticator values.
2020
- Add `unsafe_skip_file_permissions_check` flag to skip file permissions check on cache and config.
21-
- Introduce snowflake_version property to the connection
21+
- Introduce snowflake_version property to the connection.
2222
- Added basic json support for Interval types.
2323
- Moved `OAUTH_TYPE` to `CLIENT_ENVIROMENT`.
2424
- Fix bug where PAT with external session authenticator was used while `external_session_id` was not provided in `SnowflakeRestful.fetch`
2525
- Added support for parameter `use_vectorized_scanner` in function `write_pandas`.
26+
- Fixed GCS staging by ensuring the endpoint has a scheme.
2627
- Fix unclear error messages in case of incorrect `authenticator` values.
2728
- Fix case-sensitivity of `Oauth` and `programmatic_access_token` authenticator values.
2829
- Relaxed `pyarrow` version constraint, versions >= 19 can now be used.

src/snowflake/connector/gcs_storage_client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,8 @@ def get_location(
438438
if endpoint:
439439
if endpoint.endswith("/"):
440440
endpoint = endpoint[:-1]
441+
if not endpoint.startswith("https://"):
442+
endpoint = "https://" + endpoint
441443
return GcsLocation(bucket_name=container_name, path=path, endpoint=endpoint)
442444
elif use_virtual_url:
443445
return GcsLocation(

test/unit/test_gcs_client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,14 @@ def test_get_file_header_none_with_presigned_url(tmp_path):
432432
True,
433433
"https://overriddenurl.com/filename",
434434
),
435+
(
436+
"US-CENTRAL1",
437+
"https://overriddenurl.com",
438+
False,
439+
"overriddenurl.com",
440+
True,
441+
"https://overriddenurl.com/filename",
442+
),
435443
],
436444
)
437445
def test_url(

0 commit comments

Comments
 (0)