feat(cli): add get-invalid-dates command [DATA-32564]#17
Open
quocnguyendinh wants to merge 5 commits intomasterfrom
Open
feat(cli): add get-invalid-dates command [DATA-32564]#17quocnguyendinh wants to merge 5 commits intomasterfrom
quocnguyendinh wants to merge 5 commits intomasterfrom
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a new CLI entrypoint intended to programmatically fetch “invalid” diff check dates from the Diffa state table (diffa_checks) to support automated recovery workflows.
Changes:
- Added
get-invalid-datesClick command to query invalid check dates and print them as JSON. - Wired the command to existing
DiffaCheckService.get_invalid_check_dates()and added JSON serialization support.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Use DiffaCheckDatabase directly instead of DiffaCheckService to avoid requiring source/target DB URIs. CLI params are now used as filters directly, and None values skip the filter. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
027fa02 to
a1d1317
Compare
Move _validate_parsed_db_info() from _parse_db_info() to get_db_config() so individual getters like get_db_name()/get_db_schema() can work without a full DB URI. This fixes the fragile coupling where get-invalid-dates would crash without source/target URIs even though it only needs the diffa DB connection. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
a1d1317 to
92b7fee
Compare
Run pytest on every push to main and PR targeting main. This enables required status checks to block merges on test failure. Co-Authored-By: Claude Opus 4.6 (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.
DATA-32564
Background
The data-diff recovery process currently requires manually reading diff logs and copying invalid dates into the recovery DAG. To automate this, we need a CLI command that queries the diffa DB for invalid dates.
Design
get-invalid-datesCLI command that queriesdiffa_checkswhereis_valid = FalseDiffaCheckService.get_invalid_check_dates()— no new DB logicdata-difffor matching stored records["2025-10-28", "2025-11-03"])Impact
data-diffcommand or DB schemaCaveats
n/a
Testing
diffa get-invalid-dates --source-table X --target-table YDocs
N/A
Author Checklist