From f8db816fe1505ce0d7a7af58ced16161f47a5234 Mon Sep 17 00:00:00 2001 From: Adrian Egli Date: Tue, 19 Aug 2025 10:58:46 +0200 Subject: [PATCH] Update utils.py fixes the Incomplete Fix for Stage Bucket URL Handling -> Relates Change (PR #2342) --- dlt/destinations/impl/snowflake/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlt/destinations/impl/snowflake/utils.py b/dlt/destinations/impl/snowflake/utils.py index 468db44650..09a1e658a4 100644 --- a/dlt/destinations/impl/snowflake/utils.py +++ b/dlt/destinations/impl/snowflake/utils.py @@ -94,7 +94,9 @@ def gen_copy_sql( if stage_bucket_url: parsed_bucket_url = urlparse(stage_bucket_url) stage_bucket_path = parsed_bucket_url.path.lstrip("/") - if stage_bucket_path: + if parsed_bucket_url.netloc and parsed_bucket_url.scheme: + relative_url = relative_url.removeprefix(f"{parsed_bucket_url.scheme}://{parsed_bucket_url.netloc}/") + elif stage_bucket_path: relative_url = relative_url.removeprefix(stage_bucket_path) from_clause = f"FROM @{stage_name}"