Spaces:
Running
Running
Sync Space from GitHub 52ee7a4cdf673b3293c5db2cf0880e08b11fdb4b
Browse filesFiles changed (2)
34 unmodified lines353637383940418 unmodified lines459460461462463464465105 unmodified lines57157257357457557657734 unmodified linesUSER_AGENT = "pillchecker-ddinter-build"_REQUIRED_CSV_COLUMNS = {"DDInterID_A", "Drug_A", "DDInterID_B", "Drug_B", "Level"}def compute_csv_sha256(path: Path) -> str:418 unmodified linesdef sanity_check(db_path: Path,*,min_rows: int = 250_000,sentinel: tuple[str, str] = ("Warfarin", "Aspirin"),expected_severity: str = "Major",previous_size_bytes: int | None,105 unmodified linesp_check = sub.add_parser("sanity-check", help="Validate emitted SQLite")p_check.add_argument("--db-path", required=True)p_check.add_argument("--min-rows", type=int, default=250_000)p_check.add_argument("--sentinel", nargs=2, default=["Warfarin", "Aspirin"])p_check.add_argument("--expected-severity", default="Major")p_check.add_argument("--previous-size-bytes", type=int, default=None)34 unmodified lines35363738394041418 unmodified lines460461462463464465466105 unmodified lines57257357457557657757834 unmodified linesUSER_AGENT = "pillchecker-ddinter-build"_REQUIRED_CSV_COLUMNS = {"DDInterID_A", "Drug_A", "DDInterID_B", "Drug_B", "Level"}DEFAULT_MIN_INTERACTION_ROWS = 100_000def compute_csv_sha256(path: Path) -> str:418 unmodified linesdef sanity_check(db_path: Path,*,min_rows: int = DEFAULT_MIN_INTERACTION_ROWS,sentinel: tuple[str, str] = ("Warfarin", "Aspirin"),expected_severity: str = "Major",previous_size_bytes: int | None,105 unmodified linesp_check = sub.add_parser("sanity-check", help="Validate emitted SQLite")p_check.add_argument("--db-path", required=True)p_check.add_argument("--min-rows", type=int, default=DEFAULT_MIN_INTERACTION_ROWS)p_check.add_argument("--sentinel", nargs=2, default=["Warfarin", "Aspirin"])p_check.add_argument("--expected-severity", default="Major")p_check.add_argument("--previous-size-bytes", type=int, default=None)
210 unmodified lines211212213214215216210 unmodified linesassert ok is False# --- Severity conflict detection ---def test_severity_conflict_warns_and_keeps_first(tmp_path: Path, caplog):210 unmodified lines211212213214215216217218219220221210 unmodified linesassert ok is Falsedef test_sanity_check_cli_default_row_floor_tracks_current_ddinter_release():args = build_ddinter_db._build_parser().parse_args(["sanity-check", "--db-path", "data/ddinter.db"])assert args.min_rows == 100_000# --- Severity conflict detection ---def test_severity_conflict_warns_and_keeps_first(tmp_path: Path, caplog):
scripts/build_ddinter_db.py+3-2
tests/test_build_ddinter_db.py+5