Skip to content

540 standardize metadata - #541

Merged
daniel-slaugh merged 5 commits into
release/v2.0.0from
540-standardize-metadata
Sep 23, 2026
Merged

daniel-slaugh merged 5 commits into
release/v2.0.0from
540-standardize-metadata

Conversation

@daniel-slaugh

@daniel-slaugh daniel-slaugh commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Resolves #540

A couple judgement calls specifically to review:

  1. hydroserverpy had some functions that needed their required positional arguments updated since the meaning of name and code was changed for ProcessingLevels and ResultQualifiers. Mostly, this won't break code, but here are some examples of before and after. The new rule is methods take name and description by position or by name, but optional parameters are by name only.
# Before: create(code, description=None, workspace=None, uid=None)
# After:  create(name, description, *, code=None, workspace=None, uid=None)
hs_api.resultqualifiers.create("ICE", "Ice affected")        # still correct, now name + description
hs_api.resultqualifiers.create("ICE")                                 # TypeError: missing 'description'
hs_api.resultqualifiers.create(code="ICE", description="…")  # TypeError: missing 'name'

# Before: create(code, name, description)
# After:  create(name, description, code=None)
hs_api.processinglevels.create("0", "Raw", "Unprocessed data") # TypeError: takes 3 positional arguments but 4 were given
hs_api.processinglevels.create("Raw", "Unprocessed data", code="0") # OK
  1. migrations fail loudly rather than truncating: if any ObservedProperty.code, type, or definition exceeds the new limits, the migration stops and names the field. I don't think this should be a problem since the new limits are pretty generous.
  2. Definitions are now validated to be URLs, but for the migration, I'm not requiring existing free-text values to be updated. This will make the migration go through, but future edits to those tables will fail validation.
  3. There are three migrations 0017-0019. This can be squashed, but you mentioned earlier you wanted to clean up the migrations before releasing 2.0, so I'm thinking I'll just leave it as is and squashing can all be done together.

Specifically, this commit fixes breaking signature changes for the Python client where code and name were swapped so existing scripts would have loaded data into the wrong fields. Fixed some frontend display issues, reverted changes to the QC app, and standardized a few missing fields like Method.sensor_model_definition being a CharField, not a URL field like the others
@daniel-slaugh
daniel-slaugh merged commit c324dc2 into release/v2.0.0 Sep 23, 2026
10 of 12 checks passed
@daniel-slaugh
daniel-slaugh deleted the 540-standardize-metadata branch September 23, 2026 21:08
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.

2 participants