You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Working with @inguyen314 we were discussing the finer points of how to replace-all values in a timeseries with null values.
The idea being you want to write some data from a future forecast, but other data you'd want to make sure was null. Or perhaps the forecast changes and those values are now null for those dates.
Agreement
We both agreed that one should be able to interlace null values in a valid POST request where you may also want to write valid values.
Workaround
One could of course call the DELETE method and specify the date range.
Reasons not to?
But in our humble opinion Why not both?
Example
Doing the following results in a NULL POINTER exception in the logs:
This was done in javascript. I do not have a CURL command readily available but here is the Vanilla JS done to test this:
asyncfunctiondeleteTS(){// Create an array of promises to handle multiple payloadsletpromises=payloadDelete.map(ts_payload=>{returnfetch("[https://wm.mvs.ds.usace.army.mil/mvs-data/timeseries?store-rule=REPLACE%20ALL"](https://wm.mvs.ds.usace.army.mil/mvs-data/timeseries?store-rule=REPLACE%20ALL%22), {method: "POST",headers: {"accept": "*/*","Content-Type": "application/json;version=2",},body: JSON.stringify(ts_payload)}).then(asyncr=>{// Get the response message and statusconstmessage=awaitr.text();conststatus=r.status;return{'message': message,'status': status};}).catch(error=>{// Handle fetch errorsreturn{'message': error.message,'status': 'fetch_error'};});});// Wait for all promises to resolveconstreturn_values=awaitPromise.all(promises);console.log("Return values from deleteTS:",return_values);// Check for errors based on status and message contentconsthas_errors=return_values.some(v=>v.status!==200||v.message.includes("error")||v.message.includes("fail"));returnhas_errors;}
The text was updated successfully, but these errors were encountered:
Using POST for Timeseries to set NULL values
Background
Working with @inguyen314 we were discussing the finer points of how to replace-all values in a timeseries with null values.
The idea being you want to write some data from a future forecast, but other data you'd want to make sure was null. Or perhaps the forecast changes and those values are now null for those dates.
Agreement
We both agreed that one should be able to interlace
null
values in a validPOST
request where you may also want to write valid values.Workaround
One could of course call the DELETE method and specify the date range.
Reasons not to?
But in our humble opinion Why not both?
Example
Doing the following results in a NULL POINTER exception in the logs:
This was done in javascript. I do not have a CURL command readily available but here is the Vanilla JS done to test this:
The text was updated successfully, but these errors were encountered: