Skip to content

Stage runtime writer initialization fails with NameError: asdict is not defined #149

@anth-volk

Description

@anth-volk

Continuing the local PE-US rebuild smoke after working around missing PE-US-data prerequisite files (#147, #148), the run now fails immediately during versioned stage runtime writer initialization.

Important context: this failure occurred in the original checkout, which is currently on codex/stage-3-live-runtime-manifests-20260601 with local stage-runtime changes, not a clean main checkout. I am rerunning from a clean main worktree next to separate this from mainline behavior.

Command shape:

uv run --no-sync python -m microplex_us.pipelines.pe_us_data_rebuild_checkpoint \
  --output-root artifacts/local_us_microplex_smoke \
  --version-id local-smoke-v1 \
  --baseline-dataset /Users/administrator/Documents/PolicyEngine/policyengine-us-data/policyengine_us_data/storage/enhanced_cps_2024.h5 \
  --targets-db /Users/administrator/Documents/PolicyEngine/calibration-diagnostics/.artifacts/policy_data.db \
  --policyengine-us-data-repo /Users/administrator/Documents/PolicyEngine/policyengine-us-data \
  --calibration-backend microcalibrate \
  --donor-imputer-backend zi_qrf \
  --policyengine-materialize-batch-size 100000 \
  --cps-sample-n 1000 --puf-sample-n 1000 --donor-sample-n 1000 \
  --n-synthetic 1000 \
  --defer-policyengine-harness \
  --defer-policyengine-native-score \
  --defer-native-audit \
  --defer-imputation-ablation

Failure:

NameError: name 'asdict' is not defined. Did you mean: 'dict'?

Traceback location:

src/microplex_us/pipelines/artifacts.py:1576 build_and_save_versioned_us_microplex_from_source_providers
src/microplex_us/pipelines/artifacts.py:1960 _initialize_versioned_stage_runtime_writer
src/microplex_us/pipelines/artifacts.py:2008 _provider_query_plan
src/microplex_us/pipelines/artifacts.py:2020 _json_ready_query
    return _json_ready(asdict(query))

Likely direct fix: import asdict from dataclasses in pipelines/artifacts.py, unless the clean-main rerun shows this only exists on the local stage-runtime branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions