Skip to content

Handle empty results in batch geocode responses#27

Open
gaoflow wants to merge 1 commit into
Geocodio:mainfrom
gaoflow:fix-batch-geocode-empty-results
Open

Handle empty results in batch geocode responses#27
gaoflow wants to merge 1 commit into
Geocodio:mainfrom
gaoflow:fix-batch-geocode-empty-results

Conversation

@gaoflow

@gaoflow gaoflow commented Jun 26, 2026

Copy link
Copy Markdown

Summary

  • skip batch geocode entries whose nested response.results list is empty
  • keep parsing later successful entries in the same batch
  • add a regression test for mixed valid and invalid address batches

Fixes #24.

Tests

  • uv run --extra dev pytest tests/unit/test_geocode.py::test_geocode_batch_with_invalid_address_result -q
  • uv run --extra dev pytest tests/unit -q
  • uv run --extra dev black --check src/geocodio/client.py tests/unit/test_geocode.py
  • uv run --extra dev isort --check-only src/geocodio/client.py tests/unit/test_geocode.py
  • uv run --extra dev flake8 src/ --ignore=E501
  • python -m compileall -q src/geocodio tests/unit/test_geocode.py
  • git diff --check

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.

IndexError on batches with invalid addresses

1 participant