Skip to content

Preserve dataset build failure details across Modal#1112

Merged
anth-volk merged 1 commit into
mainfrom
fix/dataset-command-error-serialization
May 22, 2026
Merged

Preserve dataset build failure details across Modal#1112
anth-volk merged 1 commit into
mainfrom
fix/dataset-command-error-serialization

Conversation

@anth-volk
Copy link
Copy Markdown
Collaborator

Fixes #1111

Summary

  • Makes DatasetCommandError pickle-safe so Modal can serialize Stage 1 command failures back to the orchestrator without masking the original error.
  • Reuses captured Stage 1 command output tails when writing durable pipeline error records.
  • Keeps pipeline status payload generation resilient when latest_error.json is malformed or unreadable.

Root Cause

DatasetCommandError stored a structured DatasetCommandResult, but its RuntimeError args contained only the rendered message string. During Modal exception transport, Python pickle reconstructed the exception with that string, which made DatasetCommandError.__init__ try to read .returncode from a string.

Validation

  • uv run --no-sync pytest tests/unit/test_build_dataset_commands.py tests/unit/test_pipeline_status.py tests/unit/test_pipeline.py -q
  • ruff format --check policyengine_us_data/build_datasets/commands.py policyengine_us_data/build_datasets/status.py modal_app/pipeline.py modal_app/step_manifests/status.py tests/unit/test_build_dataset_commands.py tests/unit/test_pipeline.py tests/unit/test_pipeline_status.py
  • ruff check policyengine_us_data/build_datasets/commands.py policyengine_us_data/build_datasets/status.py modal_app/pipeline.py modal_app/step_manifests/status.py tests/unit/test_build_dataset_commands.py tests/unit/test_pipeline.py tests/unit/test_pipeline_status.py
  • make lint

@anth-volk anth-volk force-pushed the fix/dataset-command-error-serialization branch from e8646a2 to e2a5340 Compare May 22, 2026 13:50
@anth-volk anth-volk marked this pull request as ready for review May 22, 2026 14:11
@anth-volk anth-volk merged commit d57d64d into main May 22, 2026
13 checks passed
@anth-volk anth-volk deleted the fix/dataset-command-error-serialization branch May 22, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preserve dataset-build failure details across Modal boundaries

1 participant