Add source_datastream_link to waterlevel summary + trend (st2)#89
Merged
Conversation
Link each summary/trend feature back to the raw, NON-NORMALIZED source
series it was derived from. Scoped to st2 (SensorThings) sources, which
expose a Datastream URL.
- constants: SOURCE_DATASTREAM_LINK = "source_datastream_link" (source_
prefix, matching source_parameter_name/units = "as provided by source,
pre-normalization").
- st2 source: build the Datastream URL ({url}/Datastreams({id})); set it
on each observation record and, via the new _summary_extra hook, on the
summary record.
- source.RecordSummarizer: merge _summary_extra(cleaned) into the summary
rec (default {}; only st2 overrides).
- SummaryRecord gains the key, so summary features emit it. The trend
dumper reads it from the well's observation dicts and adds it to the
per-well feature.
- NOT added to timeseries features (per scope).
Offline tests cover summary + trend (present for st2, absent otherwise).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Your pull request is automatically being deployed to Dagster Cloud.
|
test_sources make live calls to provider APIs — slow and flaky for default/CI runs. Add to norecursedirs (like tests/archived). Run explicitly with --override-ini="norecursedirs=" when needed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Link each waterlevel summary and waterlevel trend feature back to the raw, non-normalized source series it was derived from. Scoped to st2 (SensorThings) sources, which expose a Datastream URL. Not added to timeseries features.
Naming
source_datastream_link— thesource_prefix matches the existingsource_parameter_name/source_parameter_unitsconvention, which already mean "as provided by the source, before DIE normalization." Constant + comments call out that it points to the non-normalized provider series.How
backend/constants.py:SOURCE_DATASTREAM_LINK = "source_datastream_link".backend/connectors/st2/source.py: builds the Datastream URL ({url}/Datastreams({id})); sets it on each observation record (so the trend path can read it) and, via a new_summary_extrahook, on the summary record.backend/source.py:RecordSummarizer.summarizemergess._summary_extra(cleaned)into the summary rec (base returns{}; only st2 overrides).backend/record.py:SummaryRecordgains the key → summary features emit it.backend/persisters/ogc_features.py: the trend dumper readssource_datastream_linkfrom the well's observation dicts and adds it to the per-well feature (omitted when absent).Scope notes
nm_waterlevels_summary) and trend (nm_waterlevel_trends) only. Timeseries features unchanged.source_datastream_link: null; trend features omit the key.Verification
Offline persister tests cover summary + trend (link present for st2, absent/None otherwise) — 17 pass.
test_sourcesnot run here (live-network integration tests).🤖 Generated with Claude Code