Skip to content

Commit 167dbd4

Browse files
committed
Fail download_ahn_laz asset on unsuccessful download, fixes #288
1 parent 9d71bdd commit 167dbd4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/core/src/bag3d/core/assets/ahn/download.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from hashlib import new as hash_new, algorithms_available
44
from dataclasses import dataclass
55

6-
from dagster import asset, Output, get_dagster_logger, Config
6+
from dagster import asset, Output, get_dagster_logger, Config, Failure
77

88
from bag3d.common.utils.requests import download_file, download_as_str
99
from bag3d.core.assets.ahn.core import (
@@ -388,6 +388,10 @@ def download_ahn_laz(
388388
success = True
389389
file_size = round(fpath.stat().st_size / 1e6, 2)
390390
is_new = False
391+
392+
if success == False:
393+
raise Failure(format_laz_log(fpath, "Downloading failed!"))
394+
391395
return LAZDownload(
392396
url=url_laz,
393397
path=fpath,

0 commit comments

Comments
 (0)