Repository navigation
Conversation
…h in refresh - ep.py reused an identical copy of us.py's ISO date parser (_iso); it now imports us.parse_date. - result() in assess_us/assess_ep takes Status instead of str, dropping two type: ignore[arg-type]. - LegalStatusRefresher.refresh assessed in a second country == "US" branch; each branch now assesses right after fetching, so the EP filing date is narrowed and the third type: ignore goes away. No behaviour change. Co-Authored-By: Claude Opus 5.5 <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.
改了什么
ep.py的_iso与us.py的_parse_date逻辑完全相同;保留us.parse_date,ep.py改为引用它。assess_us/assess_ep内的result()参数由str改为已有的Status字面量类型,删除 2 处# type: ignore[arg-type],拼错的状态值可被类型检查发现。LegalStatusRefresher.refresh原先对country == "US"判断两次;现在每个分支取数后立即判定,EP 申请日在非空检查后才使用,删除第 3 处type: ignore和一个不再使用的 import。判定行为不变(+29 / −32)。
验证
.venv/bin/pytest apps/api/tests/unit/:423 passed./scripts/test-postgres.sh:118 passed,1 failed ——test_search_api.py::test_search_planning_and_candidate_triage_lifecycle,两次运行分别因 OpenAlex 实时请求 ReadTimeout 和 HTTP 429 返回 502;该测试依赖外网,与本改动无关(另行处理)。.venv中未安装。🤖 Generated with Claude Code