Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Round Level "level-date" Post to nearest Minute #944

Open
msweier opened this issue Nov 8, 2024 · 5 comments
Open

Round Level "level-date" Post to nearest Minute #944

msweier opened this issue Nov 8, 2024 · 5 comments

Comments

@msweier
Copy link

msweier commented Nov 8, 2024

The "Level" end point returns a "level-date" parameter that includes decimal seconds. When editing a level, I posted back to the database with CDA and forgot to change the "level-date" which defaulted to a very specific time (e.g. 2024-11-08T14:30:55.147439Z). CWMS-VUE cannot display this level, and I think it is related to the specific time. CWMS-VUE cannot delete the level either even when cascade delete is called, again because I think it does not expect that specific of time. Unfortunately I don't have that time stored in memory so I can't use CDA to delete either, so I will have to bug someone who can find it and delete with SQL.

Here's the CWMS-VUE cascade delete error:
Caused by: Error : 20034, Position : 0, Sql = BEGIN "CWMS_20"."CWMS_LEVEL"."DELETE_LOCATION_LEVEL" (:1 , cast(:2 as date), :3 , :4 , :5 , :6 , :7 , :8 ) ; END;, OriginalSql = { call "CWMS_20"."CWMS_LEVEL"."DELETE_LOCATION_LEVEL" (?, cast(? as date), ?, ?, ?, ?, ?, ?) }, Error Msg = ORA-20034: ITEM_DOES_NOT_EXIST: Location level "MVP/Baldhill_Dam.Elev.Inst.0.Bottom of Flood Control@08-NOV-24" does not exist.

@msweier msweier changed the title Round Location Level "level-date" to Nearest Round Location Level "level-date" to nearest Minute Nov 8, 2024
@msweier msweier changed the title Round Location Level "level-date" to nearest Minute Round Level "level-date" Post to nearest Minute Nov 8, 2024
@MikeNeilson
Copy link
Contributor

Unfortunately if that should be rounded, it should be on save. We have a few usages, like time series, where specific components are allowed to go to subseconds. A level on retrieve has no appropriate way to determine this.

Did you save through CDA directly or CWMSVue?

@msweier
Copy link
Author

msweier commented Nov 8, 2024

Did you save through CDA directly or CWMSVue?

Saved with CDA via cwms-python. cwms-python just passes the json dictionary through.

@MikeNeilson
Copy link
Contributor

We should get @Enovotny and @perrymanmd involved, if Location Levels should only be to the minute, this is a bug on save. If they should be able to be sub minute, that's a but in CWMSVue.

@perrymanmd
Copy link

perrymanmd commented Nov 12, 2024

There is no restriction on the location level date.

The following are currently in CWBI-Test:

MVP	Baldhill_Dam.Elev.Inst.0.Bottom of Flood Control	2024-11-08 14:02:28
MVS	Carlyle Lk-Kaskaskia.Code.Inst.0.NWS HB5		2023-08-16 18:10:48
NWDP	GPR-Spillway.Flow.Inst.0.Top of Operating		2021-12-03 22:33:30
NWDP	GPR.Elev-Forebay.Inst.0.Top of Secondary Flood Control	2021-11-15 20:14:46

@msweier
Copy link
Author

msweier commented Nov 12, 2024

I figured it was a CWMS-VUE issue but would be quicker to address with CDA. I can't think of a practical need for sub-minute levels though.

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

No branches or pull requests

3 participants