duckrun 0.1.8__tar.gz → 0.1.9__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: duckrun
3
- Version: 0.1.8
3
+ Version: 0.1.9
4
4
  Summary: Lakehouse task runner powered by DuckDB for Microsoft Fabric
5
5
  Author: mim
6
6
  License: MIT
@@ -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}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: duckrun
3
- Version: 0.1.8
3
+ Version: 0.1.9
4
4
  Summary: Lakehouse task runner powered by DuckDB for Microsoft Fabric
5
5
  Author: mim
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "duckrun"
7
- version = "0.1.8"
7
+ version = "0.1.9"
8
8
  description = "Lakehouse task runner powered by DuckDB for Microsoft Fabric"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
File without changes
File without changes
File without changes
File without changes