Drop XDR exclusion from Provider model#334
Merged
hakanensari merged 1 commit intomainfrom Apr 26, 2026
Merged
Conversation
Drop the hardcoded XDR exclusion from Provider#backfill so IMF Special Drawing Rights rates from providers like NB, SBI, BCRA are no longer silently filtered. Closes #333
There was a problem hiding this comment.
Pull request overview
This PR removes the hardcoded exclusion of ISO 4217 XDR (“Special Drawing Rights”) during provider backfills so that XDR rates emitted by multiple existing adapters are ingested instead of silently dropped.
Changes:
- Removed the
EXCLUDED_QUOTES = ["XDR"]constant and its use inProvider#backfillfiltering. - Updated the provider backfill spec to assert that XDR records are imported.
- Added a changelog entry documenting the behavior change and re-backfill guidance.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/provider.rb | Stops filtering out XDR during backfill, leaving only “unknown currency code” rejection via Money::Currency.find. |
| spec/provider_spec.rb | Updates the backfill behavior test from “excludes XDR” to “ingests XDR”. |
| CHANGELOG.md | Documents that XDR is now ingested and notes the need to re-backfill to pick up previously dropped rows. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Closes #333.
Removes the hardcoded
EXCLUDED_QUOTES = ["XDR"]filter fromProvider#backfill. Several adapters (NB, SBI, BCRA, etc.) already produce XDR rates that were being silently dropped. XDR is a synthetic basket reserve unit but it's a valid ISO 4217 code, in the same category as ECU/XEU which we keep.The
moneygem already knows XDR (numeric 960), so nohistorical_currencies.jsonentry is needed. The remaining filter!Money::Currency.find(c)continues to reject unknown codes.Once merged, providers that emit XDR should be re-backfilled from
coverage_startto ingest previously-dropped rows.Test plan
APP_ENV=test bundle exec rakepasses (lint + 587 specs)provider_spec.rb"excludes XDR" → "ingests XDR" — confirmed it fails before the code change and passes after