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
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:
models.pyat the package root with aGeocoderConfigPydantic modelparse_configinui/logic.pyto useGeocoderConfigGeocoder.__init__to accept GeocoderConfigACCEPTANCE CRITERIA