From e66424cd5ecd337459fe110d2b780cf91b25804a Mon Sep 17 00:00:00 2001 From: lennartkats-db Date: Tue, 6 Oct 2026 13:47:39 +0000 Subject: [PATCH 1/2] =?UTF-8?q?[ZeroOps]=20Fix=20batch=5Fsize=20default:?= =?UTF-8?q?=200=20=E2=86=92=20250=20(incident=20cf869370)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RCA: The job parameter batch_size had a default of "0", which always failed the notebook's positive-integer validation guard (batch_size <= 0), raising ValueError: Invalid job configuration: batch_size must be greater than zero, found 0. Every run of failing_job_example_invalid_configuration (job 468689111693690, run 877581889109114) failed at validate_configuration with no way to recover until the default was corrected. Change: Updated default from "0" to "250" in knowledge_base/failing_job_examples/resources/invalid_configuration.job.yml. The notebook's int() cast and `if batch_size <= 0` guard are preserved unchanged. Only this one YAML file is committed. Base branch for PR: lennart.kats/improve-zeroops-failure-examples Incident: cf869370-f9ae-4435-9969-2fd06c81b8d2 Created using Genie ZeroOps --- .../resources/invalid_configuration.job.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/knowledge_base/failing_job_examples/resources/invalid_configuration.job.yml b/knowledge_base/failing_job_examples/resources/invalid_configuration.job.yml index 71cdf3c..e311969 100644 --- a/knowledge_base/failing_job_examples/resources/invalid_configuration.job.yml +++ b/knowledge_base/failing_job_examples/resources/invalid_configuration.job.yml @@ -9,7 +9,7 @@ resources: max_concurrent_runs: 1 parameters: - name: batch_size - default: "0" + default: "250" tasks: - task_key: validate_configuration max_retries: 0 From 1e2a13041c63cb8c5d5db28a771f77f9afb55a24 Mon Sep 17 00:00:00 2001 From: lennartkats-db Date: Tue, 6 Oct 2026 13:52:57 +0000 Subject: [PATCH 2/2] [ZeroOps] Refactor: extract parse_positive_batch_size() helper Extract the integer-parsing and positive-value guard from the top-level cell in knowledge_base/failing_job_examples/src/invalid_configuration.py into a reusable parse_positive_batch_size(value) helper with a short docstring. Both error messages are preserved verbatim: - "batch_size must be an integer, found {value!r}" - "batch_size must be greater than zero, found {batch_size}" The `from None` suppression on the except branch is retained. Call-site behaviour is unchanged: batch_size ends up as a validated int in scope. batch_size default remains "250" from the preceding commit. Incident: cf869370-f9ae-4435-9969-2fd06c81b8d2 Created using Genie ZeroOps --- .../src/invalid_configuration.py | 34 ++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/knowledge_base/failing_job_examples/src/invalid_configuration.py b/knowledge_base/failing_job_examples/src/invalid_configuration.py index 51ea9fd..9b60ff4 100644 --- a/knowledge_base/failing_job_examples/src/invalid_configuration.py +++ b/knowledge_base/failing_job_examples/src/invalid_configuration.py @@ -1,14 +1,24 @@ # Databricks notebook source -batch_size_value = dbutils.widgets.get("batch_size") +def parse_positive_batch_size(value): + """Parse *value* as a positive integer batch size. + + Raises ValueError with a descriptive message if *value* cannot be + converted to an integer or is not greater than zero. + """ + try: + batch_size = int(value) + except ValueError: + raise ValueError( + f"Invalid job configuration: batch_size must be an integer, found {value!r}" + ) from None + + if batch_size <= 0: + raise ValueError( + f"Invalid job configuration: batch_size must be greater than zero, found {batch_size}" + ) -try: - batch_size = int(batch_size_value) -except ValueError: - raise ValueError( - f"Invalid job configuration: batch_size must be an integer, found {batch_size_value!r}" - ) from None - -if batch_size <= 0: - raise ValueError( - f"Invalid job configuration: batch_size must be greater than zero, found {batch_size}" - ) + return batch_size + + +batch_size_value = dbutils.widgets.get("batch_size") +batch_size = parse_positive_batch_size(batch_size_value)