Skip to content

Expose the distance of geo search results - #1578

Merged
frenck merged 1 commit into
mainfrom
frenck/station-distance
Oct 1, 2026
Merged

frenck merged 1 commit into
mainfrom
frenck/station-distance

Conversation

@frenck

@frenck frenck commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Breaking change

None. Station gets a new optional distance attribute, which is None unless the station is the result of a geo search.

Proposed change

Found in a second review of the library. For a geo search (#1560), the API returns the distance of every station to the requested location in geo_distance, in meters. The Station model dropped it, so callers could not show or sort by how far away a station is.

Station.distance now holds it, and the README shows how to list the nearest stations first. Checked against the live API: within 5 km of Amsterdam, the results come back with their distance, and a plain search keeps distance at None.

Type of change

  • Dependency or tooling upgrade
  • Bugfix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Deprecation (replaces or removes a feature, with a migration path)
  • Breaking change (a fix or feature that changes existing behavior)
  • Code quality, refactor, or test-only change
  • Documentation only

Additional information

Checklist

  • I fully understand the code in this pull request and can explain every line, including any AI-assisted changes.
  • The change is covered by tests, and poetry run pytest passes locally. A pull request cannot be merged unless CI is green.
  • poetry run prek run --all-files passes (lint, format, and type checks).
  • No commented-out or dead code is left in the pull request.

The API returns the distance to the requested location for every result
of a geo search, but the Station model dropped it.
@frenck frenck added the new-feature New features or options. label Oct 1, 2026
@frenck
frenck merged commit 7b1d9ca into main Oct 1, 2026
31 checks passed
@frenck frenck mentioned this pull request Oct 1, 2026
4 of 11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature New features or options.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant