Skip to content
Open
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
6 changes: 6 additions & 0 deletions .changes/unreleased/Features-20260210-094912.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Features
body: adds proxies to download function, necessary for running DBT without setting global proxy vars
time: 2026-02-10T09:49:12.7780767+11:00
custom:
Author: mansfieldj3
Issue: "348"
10 changes: 7 additions & 3 deletions dbt_common/clients/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,20 +581,24 @@ def run_cmd(cwd: str, cmd: List[str], env: Optional[Dict[str, Any]] = None) -> T


def download_with_retries(
url: str, path: str, timeout: Optional[Union[float, tuple]] = None
url: str,
path: str,
timeout: Optional[Union[float, tuple]] = None,
proxies: Optional[Dict[str, str]] = None,
) -> None:
download_fn = functools.partial(download, url, path, timeout)
download_fn = functools.partial(download, url, path, timeout, proxies)
connection_exception_retry(download_fn, 5)


def download(
url: str,
path: str,
timeout: Optional[Union[float, Tuple[float, float], Tuple[float, None]]] = None,
proxies: Optional[Dict[str, str]] = None,
) -> None:
path = convert_path(path)
connection_timeout = timeout or float(os.getenv("DBT_HTTP_TIMEOUT", 10))
response = requests.get(url, timeout=connection_timeout)
response = requests.get(url, timeout=connection_timeout, proxies=proxies)
with open(path, "wb") as handle:
for block in response.iter_content(1024 * 64):
handle.write(block)
Expand Down