Skip to content

feat: make USDA API key optional#17

Merged
koen-vg merged 1 commit into
Sustainable-Solutions-Lab:mainfrom
koen-vg:feat/optional-usda-key
Jul 1, 2026
Merged

feat: make USDA API key optional#17
koen-vg merged 1 commit into
Sustainable-Solutions-Lab:mainfrom
koen-vg:feat/optional-usda-key

Conversation

@koen-vg

@koen-vg koen-vg commented Jul 1, 2026

Copy link
Copy Markdown
Member

The USDA FoodData Central key was required at workflow startup (the secrets loader raised and the config schema demanded it), even though only the retrieve_usda_nutrition rule consumes it. That rule runs only when refreshing nutrition data after adding a food, so a default build now needs no credentials at all.

  • secrets loader gathers whatever credentials are configured without raising; the schema no longer requires credentials or usda.api_key
  • retrieve_usda_nutrition raises a clear error if the key is missing, but only when the rule actually runs
  • data.usda.retrieve_nutrition defaults to false, so the default DAG uses the bundled data/curated/nutrition.csv and omits the rule
  • drop the now-unneeded credentials stub in solve_namespace and the vestigial USDA_API_KEY stub in the CI dryrun job
  • update docs/comments to describe the current state

The USDA FoodData Central key was required at workflow startup (the
secrets loader raised and the config schema demanded it), even though
only the retrieve_usda_nutrition rule consumes it. That rule runs only
when refreshing nutrition data after adding a food, so a default build
now needs no credentials at all.

- secrets loader gathers whatever credentials are configured without
  raising; the schema no longer requires credentials or usda.api_key
- retrieve_usda_nutrition raises a clear error if the key is missing,
  but only when the rule actually runs
- data.usda.retrieve_nutrition defaults to false, so the default DAG
  uses the bundled data/curated/nutrition.csv and omits the rule
- drop the now-unneeded credentials stub in solve_namespace and the
  vestigial USDA_API_KEY stub in the CI dryrun job
- update docs/comments to describe the current state
@koen-vg koen-vg merged commit 66fc774 into Sustainable-Solutions-Lab:main Jul 1, 2026
4 checks passed
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.

1 participant