Skip to content

Fix Tests workflow regressions from safety-data junction schema changes - #2947

Draft
ziv17 with Copilot wants to merge 4 commits into
new-cbs-formatfrom
copilot/fix-tests-job-failure
Draft

Fix Tests workflow regressions from safety-data junction schema changes#2947
ziv17 with Copilot wants to merge 4 commits into
new-cbs-formatfrom
copilot/fix-tests-job-failure

Conversation

Copilot AI commented Aug 13, 2026

Copy link
Copy Markdown

The Tests GitHub Actions job was failing after safety-data schema changes removed non_urban_intersection from marker views while related widget filtering still depended on it. The same branch also left a few tests pinned to pre-migration severity IDs and vehicle mappings.

  • Junction filtering

    • Update road-segment junction expansion to use the current marker view shape:
      • prefer non_urban_intersection when present,
      • fall back to intersection,
      • return false() when the view has no junction field or the segment has no mapped junctions.
    • This prevents widget queries from raising attribute errors on updated marker views.
  • Severity filter compatibility

    • Replace hardcoded injured severity IDs in widget filter construction with InjurySeverity.codes().
    • Keeps query filters aligned with the new CBS-backed severity values.
  • Targeted test updates

    • Update enum-backed test fixtures to use current AccidentSeverity values.
    • Refresh involved-query expectations for the new safety-data mappings and sample records.
    • Add coverage for the new intersection fallback and the false() behavior when junction expansion is unavailable.
def get_expression_for_segment_junctions(segment_id: int, table_obj):
    sg = SegmentJunctions.get_instance()
    junctions = sg.get_segment_junctions(segment_id)
    if not junctions:
        return false()
    if hasattr(table_obj, "non_urban_intersection"):
        field = getattr(table_obj, "non_urban_intersection")
    elif hasattr(table_obj, "intersection"):
        field = getattr(table_obj, "intersection")
    else:
        return false()
    return field.in_(junctions)

Copilot AI and others added 3 commits August 13, 2026 13:48
Co-authored-by: ziv17 <28224696+ziv17@users.noreply.github.com>
Co-authored-by: ziv17 <28224696+ziv17@users.noreply.github.com>
Co-authored-by: ziv17 <28224696+ziv17@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions job Tests Fix Tests workflow regressions from safety-data junction schema changes Aug 13, 2026
Copilot AI requested a review from ziv17 August 13, 2026 13:52
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.

2 participants