Skip to content

UK economy: constituency_impact and local_authority_impact changed from dict to list, breaking the maps #3955

Closed

Description

@PavelMakarchuk

Problem

UK economy results now return constituency_impact and local_authority_impact as lists, so the app's constituency and local authority maps show "No constituency data available" in production (v2 and v3).

GET /uk/economy/85546/over/1?region=uk&time_period=2026 (resolved_app_name: policyengine-simulation-py6-5-0, policyengine_bundle.model_version: 2.130.1):

  • result.constituency_impact: a list of 632 objects {constituency_code, constituency_name, x, y, average_household_income_change, relative_household_income_change, population}
  • result.local_authority_impact: a list of 363 objects with local_authority_code, local_authority_name and the same fields

The documented and previous shape (still emitted by the code in this repo) is a dict:

"constituency_impact": {
  "by_constituency": { "<name>": { "x": ..., "y": ..., "average_household_income_change": ..., "relative_household_income_change": ... } },
  "outcomes_by_region": { "england": { "Gain more than 5%": ..., ... }, ... }
}

The list shape also drops outcomes_by_region.

Request

  1. Confirm which shape is the contract for /{country}/economy.
  2. If the list is intended, document it and say whether outcomes_by_region is gone. If not, restore the dict shape.

App side

The app is being changed to accept both shapes (PolicyEngine/policyengine-app-v2, UK maps PR), so the maps work again either way.

Activity

  1. PavelMakarchuk commented on Oct 23, 2026

    @PavelMakarchuk
    CollaboratorAuthor

    Fixed by #4024 with app-v2 #1398, now live. Checked on production data after the 4024 deploy: the local-area breakdown returns constituency_impact and local_authority_impact as lists, and the v3 "Local areas" tab (report 4729) shows both maps, the top and bottom five, the disclosure notes (71 of 650 constituencies and 56 of 361 local authorities not published), and Northern Ireland (Belfast West −£38, 90% range −£51 to −£27). I could not open a saved v2 report in the browser; #1398's unit tests cover the v2 constituency and local-authority sub-pages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions