Repository navigation
Claim generic-CSV adapter when headers fully resolve; fall back to history import - #41
Open
vinay-veerappa wants to merge 2 commits into
Open
vinay-veerappa wants to merge 2 commits into
vinay-veerappa wants to merge 2 commits into
Conversation
…ry into import API fallback
…rted f375ac6 made genericCsvAdapter claim a table whose headers resolve to a complete trade (symbol, direction, both times, both prices, quantity, P&L), and 8 tests still asserted the old rule that the generic mapper is reachable only by explicit choice. The complete-shape fixtures now go through parseClaimedGeneric, which asserts the automatic route imports exactly what the explicit adapter does. The incomplete shapes (pipe fills, no P&L column) keep asserting parseAuto is null. The routing test now proves both directions: GENERIC is claimed, and fills or the same table minus its P&L column still go to the column mapper. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
What
Two changes to statement import fallbacks:
The generic CSV adapter now CLAIMS a file when its header row fully resolves against a known trade shape, instead of declining it to whatever comes next. A statement whose headers are unambiguous is parsed locally; a file whose headers only partially resolve still declines exactly as before.
The import API's no-mapping path now falls back to the history importer (\parseHistory) when \parseAuto\ declines: \parseAuto(value) ?? parseHistory(value). Statements with a full trade shape that auto-detect skipped are imported instead of rejected with 'could not detect format'.
Verification
Co-Authored-By: Claude noreply@anthropic.com