Draft
Conversation
Check cached dataset config against incoming config on cache hit. If they differ, remove the stale entry and reload from source. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Collaborator
Author
|
/deploy-review
|
Replace TTL-based dataset cache with AsyncLoadingCache that accepts a loader and validator per get() call. Concurrent loads for the same key are deduplicated by storing futures directly. Move cache logic from _get_dataset to get_dataset for cleaner separation. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Collaborator
Author
|
/deploy-review
|
Fedir-Yatsenko
commented
Mar 23, 2026
| dataset_config = self.parse_data_set_config(config) | ||
| return await self._dataset_cache.get( | ||
| key=str(entity_id), | ||
| loader=lambda: self._get_dataset(entity_id, title, config, auth_context), |
Collaborator
Author
There was a problem hiding this comment.
This behavior is not correct. If allow_offline=True and any problems occur, get_dataset should return an OfflineDataset without caching it
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.
Applicable issues
N/A
Description of changes
Problem: When a dataset is retrieved from the in-memory cache, the system doesn't check whether its configuration has changed since it was cached. If an admin updates a dataset's config (e.g., dimensions, URN, citation, include_attributes), the stale cached dataset continues to be served until TTL expiry.
Solution: On cache hit in
QuanthubSdmx21DataSourceHandler._get_dataset(), compare the cached dataset's config against the incoming config using Pydantic model equality. If they differ, the stale entry is removed and the dataset is reloaded from the SDMX source.Also improved logging in
_propagate_config_to_channel_datasetsto trace per-channel-dataset decisions (skipped, auto-updated, needs reindex).Checklist
Reviewenvironment.By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.