feat: add normalized chemistry results materialized view and update related configurations#584
Conversation
…elated configurations
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 884ffc66eb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Adds a new pygeoapi-exposed OGC collection backed by a PostgreSQL materialized view that pivots “major chemistry” results into normalized/static analyte columns, and wires it into refresh tooling and local dev config.
Changes:
- Add Alembic migration creating
ogc_normalized_chemistry_resultsmaterialized view + unique index for refresh support. - Register the new collection in
core/pygeoapi-config.ymland include it in the CLI refresh list. - Update tests and local Docker/dev startup configuration to account for the new view/collection.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_ogc.py | Ensures the new normalized_chemistry_results collection appears and its items endpoint works. |
| tests/test_cli_commands.py | Updates refresh-matview command expectations to include the new matview and updated count. |
| entrypoint.sh | Makes DB readiness check configurable via env, and updates log message. |
| docker-compose.yml | Splits DB into db_dev and db_test, updates app wiring to db_dev, and renames volumes. |
| core/pygeoapi-config.yml | Registers normalized_chemistry_results OGC resource pointing at ogc_normalized_chemistry_results. |
| cli/cli.py | Adds ogc_normalized_chemistry_results to default refresh list. |
| alembic/versions/b6f7a8b9c0d1_add_normalized_chemistry_results_materialized_view.py | New migration creating the normalized chemistry results materialized view + index. |
You can also share your feedback on Copilot code review. Take the survey.
…with local development setup
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
You can also share your feedback on Copilot code review. Take the survey.
…and update related configurations
Summary
This PR adds normalized chemistry materialized views for water wells, exposes them as pygeoapi collections, hardens startup/CI behavior, and aligns docs/config for Docker/ENV usage.
Primary changes
1. Major chemistry normalized view (water wells)
Updated existing migration:
What it now does:
thing_type = 'water well'analysis_datefallback tocollection_date)*_unitsstatic columnslatest_chemistry_dateCa,Ca(total),SO4,IONBAL,TAn,TCat,Na+K, etc.)2. New minor chemistry normalized view (water wells)
Added migration:
Creates:
ogc_minor_chemistry_wellsmaterialized view with:*_unitscolumnslatest_chemistry_dateanalyte_countpygeoapi collection changes
Updated:
Changes:
normalized_chemistry_results-> Major Chemistry (Water Wells)minor_chemistry_wells-> Minor Chemistry (Water Wells)CLI refresh defaults
Updated:
Added to default refresh set:
ogc_normalized_chemistry_resultsogc_minor_chemistry_wellsTest expectation updates:
OGC test updates
Updated collection assertions/endpoints:
Startup/Compose/CI improvements
Fail-fast entrypoint
Updated:
set -euso migration failures stop startup before Uvicorn launches.Compose service/profile adjustments
Updated:
Changes:
db_testis now opt-in (profiles: ["test"])ocotilloapi_devocotilloapi_testCI service name fix
Updated:
Changes:
docker compose build db->docker compose build db_devdocker compose up -d db->docker compose up -d db_devDocumentation/env alignment (Option B)
Updated:
Changes:
.env.examplenow aligns with Compose dev DB name (POSTGRES_DB=ocotilloapi_dev)db_dev,db_testprofile)Validation highlights
ocotilloapi_testDB in this environment.