Skip to content

[PATCH] TimeSeries Group does not update description #1607

@krowvin

Description

@krowvin

Describe the bug
Attempting to use the PATCH HTTP method to update a timeseries group with new TSIDs via replace-assigned-ts works.

However, the description does not get updated. Attempting to store a timestamp here, for now, to show when it was last updated.

Requires doing another post to update the description, to then also do a patch to update the timeseries to get this to work.

Expected behavior
Expect patch to update any fields provided and ignore any fields not presented.

i.e. if no "description" key is in the payload, do nothing. VS if a "description" key is present but set to null (JSON) then remove the description.

In this case, new description is provided. Patch should patch that field and the provided assigned-time-series field.

To Reproduce
Navigate to SwaggerUI on CWBI dev and POST a new TS Group. Set a unique description. Change description and POST again. Changes.

Then do a PATCH on the TSGroup endpoint with a third description. No change.

CURL Commands
create the group initially - set value to 5

curl -X 'POST' \
  'https://water.dev.cwbi.us/cwms-data/timeseries/group?fail-if-exists=false' \
  -H 'accept: */*' \
  -d '{
  "office-id": "SWT",
  "id": "dbview",
  "time-series-category": {
    "office-id": "SWT",
    "id": "KEYS"
  },
  "description": "Updated 5",
  "assigned-time-series": [
  
  ]
}'

get group by id - shows 5 in desc

curl -X 'GET' \
  'https://water.dev.cwbi.us/cwms-data/timeseries/group/dbview?office=SWT&category-office-id=SWT&group-office-id=SWT&category-id=KEYS&_cb=1772058820391' \
  -H 'accept: application/json'

patch group, with empty TS (I tried with TSIDS too but I don't have them all on Dev)

curl -X 'PATCH' \
  'https://water.dev.cwbi.us/cwms-data/timeseries/group/dbview?replace-assigned-ts=true&office=SWT' \
  -H 'accept: */*' \-H 'Content-Type: application/json' \
  -d '{
  "office-id": "SWT",
  "id": "dbview",
  "time-series-category": {
    "office-id": "SWT",
    "id": "KEYS"
  },
  "description": "Updated 2345",
  "assigned-time-series": [
  
  ]
}'

Do the get again and still see 5 in desc instead of 2345 unless you POST again with that value. Post cannot be used to completely update the TS assigned. It interlaces them.

CDA Version (please complete the following information):

  • Version 2026.02.25-develop

Additional context
Creating a python script to use regex to group projects from catalog, a regex against TS catalog, to then turn around and create TS Groups for a webpage with specific TS we want location to have visible in the webpage.

Script updates the timestamp they were updated at with the idea being cwmsvue/webpage could be used later to further set the attributes (column order)/new/remove TS to this group changing the UI.

You cannot POST twice because this interlaces the timeseries. Requiring you to patch with the mentioned replaced-assigned-ts to correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions