Expose maxDataPoints to storage finders#159
Open
mbell697 wants to merge 1 commit intobrutasse:masterfrom
Open
Conversation
5f2457c to
0d6083e
Compare
brutasse
requested changes
Oct 14, 2016
Owner
brutasse
left a comment
There was a problem hiding this comment.
Thanks! A minor change would be nice, to make it slightly simpler to write compatible finders.
| if hasattr(self.reader, '__aggregating__'): | ||
| return self.reader.fetch(startTime, endTime, maxDataPoints) | ||
| else: | ||
| return self.reader.fetch(startTime, endTime) |
Owner
There was a problem hiding this comment.
Can you use inspect.signature (or getargspec on Python 2) to "guess" the ability of .fetch to accept maxDataPoints instead of having to rely on a magic attribute?
Or do a try… except TypeError but it would be less elegant…
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 exposes
maxDataPointsto custom finders/readers so they may pre-compute rollups at the storage layer. Fixes the primary request of #109.This doesn't implement another feature mentioned in that issue: to pass the consolidation function defined via
consolidateByto the finder/reader. That could be an area of improvement in the future but I can't dream up an application for it at the moment.The implementation requires an attr flag be set on the finder/reader to avoid breaking backward compatibility with existing plugins.
There are a few related code paths in here that don't look to have great test coverage so I would hold off on merging this until I can do a bit of end to end testing with a finder/reader implementation that supports it, particularly with multi-fetch. I'll be testing this in the day or two.