Skip to content

BUGFIX: Empty address fields with spaces getting treated as non-empty #142

Description

@CaitlinCP

Config parsing is duplicated between the CLI entrypoint and the Streamlit app (ui/logic.py)

There is a risk where the two paths normalize values inconsistently. Neither path handles explicitly blank YAML values.

SOLUTION:

  • Include a Pydantic dependency
  • Add a models.py at the package root with a GeocoderConfig Pydantic model
  • Coerce empty strings to None in model validators
  • Update the CLI entrypoint and parse_config in ui/logic.py to use GeocoderConfig
  • Update Geocoder.__init__ to accept GeocoderConfig

ACCEPTANCE CRITERIA

  • A YAML config with blank address_fields should no longer cause the geocoder to treat those fields as populated
  • Both the CLI and app code paths produce equivalent config objects from the same YAML input

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendbugSomething isn't workingpythonPull requests that update python codepython:uvPull requests that update python:uv code

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions