fix(loaders): honor interval in local loader by resampling#467
Merged
Conversation
The local loader accepted an ``interval`` argument but passed it only to the cache key, so requesting e.g. 4H against hourly data silently returned the file's native bars. Resample to the requested interval using the same OHLCV aggregation as the yfinance loader (open=first, high=max, low=min, close=last, volume=sum). A finer-than-source interval cannot be fabricated from a file, so the source bars are returned unchanged with a warning; requests already matching the source granularity are passed through. The end-date filter is now inclusive of the whole end day so intraday bars on that day survive for sub-daily intervals. Signed-off-by: Lanre Shittu <136805224+Shizoqua@users.noreply.github.com>
Collaborator
|
Merged — thanks. The cache-version bump so stale entries can't mask the fix is exactly right, and the inclusive end-day filter closes the sub-daily edge case. Verified locally: local-loader + cache helper tests green. |
warren618
added a commit
that referenced
this pull request
Jul 12, 2026
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.
The local loader accepted an
intervalargument but passed it only to the cache key, so requesting e.g.4Hagainst hourly data silently returned the file's native bars.Changes
Testing