Skip to content

fix: override GTFS-RT entity types during populate - #1822

Open
mackenziereading19 wants to merge 1 commit into
MobilityData:mainfrom
mackenziereading19:fix/1812-override-entity-types
Open

fix: override GTFS-RT entity types during populate#1822
mackenziereading19 wants to merge 1 commit into
MobilityData:mainfrom
mackenziereading19:fix/1812-override-entity-types

Conversation

@mackenziereading19

@mackenziereading19 mackenziereading19 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #1812.

GTFS-RT entity types were previously added to the existing relationship during catalogue population rather than replacing the previous catalogue values.

This meant that if a feed changed from, for example:

  • sa|vp
  • to sa

the stored result remained sa|vp.

This change clears the existing entity-type relationship before applying a non-empty catalogue entity_type value, so the latest catalogue row replaces the previous values.

Regression coverage

Added an integration regression using the existing layered populate fixture:

  • earlier populate row: sa|vp
  • later populate row: sa
  • expected final API value: ["sa"]

Before the fix, the test failed with:

['sa', 'vp'] != ['sa']

After the fix, it passes.

Tests

  • focused regression: 1 passed
  • populate integration package: 21 passed
  • relevant API/model tests: 130 passed

Empty entity_type cell semantics are intentionally unchanged by this patch.

@mackenziereading19
mackenziereading19 force-pushed the fix/1812-override-entity-types branch from be838a0 to ac71ee4 Compare September 1, 2026 15:56
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.

Populate script: Entity types are added rather than overridden from the catalogs, causing an error in the API

1 participant