duckrun 0.1.8__py3-none-any.whl → 0.1.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- duckrun/core.py +15 -3
- {duckrun-0.1.8.dist-info → duckrun-0.1.9.dist-info}/METADATA +1 -1
- duckrun-0.1.9.dist-info/RECORD +7 -0
- duckrun-0.1.8.dist-info/RECORD +0 -7
- {duckrun-0.1.8.dist-info → duckrun-0.1.9.dist-info}/WHEEL +0 -0
- {duckrun-0.1.8.dist-info → duckrun-0.1.9.dist-info}/licenses/LICENSE +0 -0
- {duckrun-0.1.8.dist-info → duckrun-0.1.9.dist-info}/top_level.txt +0 -0
duckrun/core.py
CHANGED
@@ -453,6 +453,7 @@ class Duckrun:
|
|
453
453
|
|
454
454
|
Returns:
|
455
455
|
True if all tasks succeeded
|
456
|
+
False if any task failed (exception) or Python task returned 0 (early exit)
|
456
457
|
"""
|
457
458
|
if self.sql_folder is None:
|
458
459
|
raise RuntimeError("sql_folder is not configured. Cannot run pipelines.")
|
@@ -463,22 +464,33 @@ class Duckrun:
|
|
463
464
|
print('='*60)
|
464
465
|
|
465
466
|
try:
|
467
|
+
result = None
|
468
|
+
|
466
469
|
if len(task) == 2:
|
467
470
|
name, second = task
|
468
471
|
if isinstance(second, str) and second in {'overwrite', 'append', 'ignore'}:
|
469
|
-
self._run_sql(name, second, {})
|
472
|
+
result = self._run_sql(name, second, {})
|
470
473
|
else:
|
471
474
|
args = second if isinstance(second, (tuple, list)) else (second,)
|
472
|
-
self._run_python(name, tuple(args))
|
475
|
+
result = self._run_python(name, tuple(args))
|
473
476
|
|
474
477
|
elif len(task) == 3:
|
475
478
|
table, mode, params = task
|
476
479
|
if not isinstance(params, dict):
|
477
480
|
raise ValueError(f"Expected dict for params, got {type(params)}")
|
478
|
-
self._run_sql(table, mode, params)
|
481
|
+
result = self._run_sql(table, mode, params)
|
479
482
|
|
480
483
|
else:
|
481
484
|
raise ValueError(f"Invalid task format: {task}")
|
485
|
+
|
486
|
+
# Check if Python task returned 0 (early exit condition)
|
487
|
+
# Only check for Python tasks as SQL tasks return table names (strings) and only stop on exceptions
|
488
|
+
if (len(task) == 2 and
|
489
|
+
not isinstance(task[1], str) and
|
490
|
+
result == 0):
|
491
|
+
print(f"\n⏹️ Python task {i} returned 0 - stopping pipeline execution")
|
492
|
+
print(f" Remaining tasks ({len(pipeline) - i}) will not be executed")
|
493
|
+
return False
|
482
494
|
|
483
495
|
except Exception as e:
|
484
496
|
print(f"\n❌ Task {i} failed: {e}")
|
@@ -0,0 +1,7 @@
|
|
1
|
+
duckrun/__init__.py,sha256=L0jRtD9Ld8Ti4e6GRvPDdHvkQCFAPHM43GSP7ARh6EM,241
|
2
|
+
duckrun/core.py,sha256=0ShFCe9tPmrd2fsH_AHCwzSQ03gXbaWWwmgNTyi5pYo,34064
|
3
|
+
duckrun-0.1.9.dist-info/licenses/LICENSE,sha256=-DeQQwdbCbkB4507ZF3QbocysB-EIjDtaLexvqRkGZc,1083
|
4
|
+
duckrun-0.1.9.dist-info/METADATA,sha256=vno1WFSAviBvJfBc09zPmELxYD6LTmpIWj52sqUYRaE,13847
|
5
|
+
duckrun-0.1.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
6
|
+
duckrun-0.1.9.dist-info/top_level.txt,sha256=BknMEwebbUHrVAp3SC92ps8MPhK7XSYsaogTvi_DmEU,8
|
7
|
+
duckrun-0.1.9.dist-info/RECORD,,
|
duckrun-0.1.8.dist-info/RECORD
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
duckrun/__init__.py,sha256=L0jRtD9Ld8Ti4e6GRvPDdHvkQCFAPHM43GSP7ARh6EM,241
|
2
|
-
duckrun/core.py,sha256=NrGriuJO7Mh1e9NKplNKkNleUWBpIKG5CwJGj3qNxxw,33334
|
3
|
-
duckrun-0.1.8.dist-info/licenses/LICENSE,sha256=-DeQQwdbCbkB4507ZF3QbocysB-EIjDtaLexvqRkGZc,1083
|
4
|
-
duckrun-0.1.8.dist-info/METADATA,sha256=CsvDljoHqgKfoDDdxHmNoKiR1PJNkqf6ye3hbxWm118,13847
|
5
|
-
duckrun-0.1.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
6
|
-
duckrun-0.1.8.dist-info/top_level.txt,sha256=BknMEwebbUHrVAp3SC92ps8MPhK7XSYsaogTvi_DmEU,8
|
7
|
-
duckrun-0.1.8.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|