ESS-2234: Add wrapper for new endpoint for fetching aggregated timeseries#120
Merged
branislav-jenco-4ss merged 18 commits intomasterfrom Jan 12, 2024
Conversation
Contributor
heidi-holm-4ss
left a comment
There was a problem hiding this comment.
Do we want to include a raise_empty flag similar to the old method? We should also update the documentation with a practical example.
Contributor
Author
|
note to self:
|
| stop=stop_after_attempt( | ||
| 4 | ||
| ), # Attempt!, not retry attempt. Attempt 2, is 1 retry | ||
| retry=retry_if_exception_type( |
Contributor
Contributor
Author
There was a problem hiding this comment.
Indeed! Let's keep it in mind.
bjartwolf
approved these changes
Jan 12, 2024
bjorn-einar-bjartnes-4ss
approved these changes
Jan 12, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR is related to user story [ESS-2234]
Description
This PR adds a new method
get_samples_aggregatetheclientwhich is a wrapper to our new endpoint that supports simplified fetching of aggregated timeseries. It takes four required arguments: the start and end date, as anything which can be parsed bypandas.to_datetime, an aggregation period and an aggregation function, as well as optionally the max page size used when paging the response. The same limitations as in the API apply. As of now, there is no caching implemented for this method.It's sort of a first draft, and in the implementation I made a couple choices that we might discuss:
series, just like the oldgetmethodpandas.to_datetime()can parse, just like the oldgetmethodmax_page_sizeis a parameter but maybe it's not necessary