Skip to content

Conversation

@adamkorynta
Copy link
Collaborator

@adamkorynta adamkorynta commented Apr 12, 2024

adds spec and instance endpoints with unit test coverage via mock server

Copy link

@MikeNeilson MikeNeilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Have a few questions. But I'll let the people who are more directly working within the cwms python approve or not.

"issue-date": issue_date.isoformat(),
}

headers = {"Accept": constants.HEADER_JSON_V2}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't notice this in the other work but this is the first version of this data, so we can just use plain application/json. the V2 json was to provide a difference for the original from the DB outputs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I thought the pattern was all v1 was direct to db and starting v2 was not, even for new code. All of the new data types (binary, text, etc) are using V2.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it was "first instance of type" is V1.

... whelp, apparently I wasn't paying attention as well as I thought (to be fair I was focusing on the logic).
But it's not a huge deal, we'll be making the application/json be a aliases to the prefered anyways.

params = {
constants.OFFICE_PARAM: office,
constants.NAME: spec_id,
"designator": designator,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be a constant as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, forgot to do that

"first-date-time": 1692702150000,
"last-date-time": 1727017260000,
"max-age": 5,
"time-series-count": 3,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we planning a separate endpoint to get the time series or time series id's. I wouldn't expected a list somewhere like the location-ids above.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The timeseries id's come back as a list for the spec. No need for a separate endpoint for the forecast timeseries since we already get the list of ids.

Copy link

@MikeNeilson MikeNeilson Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duh, I can read. This is what happens when you review things 30 minutes after actually waking up.

@adamkorynta adamkorynta merged commit e7deebe into HydrologicEngineeringCenter:main Apr 15, 2024
@adamkorynta adamkorynta deleted the feature/forecast branch April 15, 2024 20:22
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.

3 participants