Fix datetime day filtering - #767
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
|
Update on the failing The branch has already gone through an autofix → restore → autofix loop on Could a maintainer advise whether to treat this check as a repository baseline issue, or whether you would prefer a separate repo-wide notebook-formatting PR first? |
|
Hi @driavysinus, thanks for the fix and for digging into the CI failure! 🙏 You're right — this is a repository baseline issue, not something your change introduced. I just ran Keeping this PR scoped to the bug fix is the right call — please don't add the repo-wide notebook changes here. We'll take care of the notebook formatting in a separate PR on our end. Thanks again for the contribution, the |
…able dependencies (#768) * Remove redundant nbqa hooks that conflict with ruff-format The nbqa-black and nbqa-ruff hooks duplicate what the ruff and ruff-format hooks already do for notebooks (types_or includes jupyter), and black disagrees with ruff-format about blank lines in notebook cells. This caused pre-commit.ci to loop endlessly, reformatting 11 notebooks on every run and blocking unrelated PRs (e.g. #767). With the nbqa hooks removed, the full suite passes on a clean checkout with no notebook changes required. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Regenerate poetry.lock to remove bogus aarch64 platform markers The lock file had been regenerated with Poetry 2.1.1, which narrowed markers to the locking platform and stamped nearly every package with 'platform_system == "Linux" and platform_machine == "aarch64"'. On CI's x86_64 runners poetry therefore installed only ~14 packages, so pre-commit and sphinx-build were missing and the code-check and docs jobs have failed on every run since. Regenerated with Poetry 2.4.1 (same package versions, no updates). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Remove integration tests workflow It targets self-hosted runners (gpu, db) that are no longer available, so the job queues forever and blocks PR checks from completing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Migrate to Python 3.11 and uv, fix version-drift breakages Packaging: - Convert pyproject.toml to PEP 621 with uv dependency groups and the hatchling build backend; replace poetry.lock with uv.lock - Require Python 3.11 (single-version window, >=3.11,<3.12) - Bump torch to ^2.0 (resolves 2.13.0) since torch 1.x has no cp311 wheels; torchvision follows - Security-driven updates now resolvable: urllib3 2.7.0, requests 2.34.2, setuptools 80.x (capped <81 for pybtex's pkg_resources), pytest 9, jupyterlab 4.6 - Pin scikit-learn <1.8 (cyclops imports the private _binary_clf_curve, removed in 1.8) and torchmetrics <1.3 (metric tests are written against its 1.2 zero-division reference behavior) CI and tooling: - Rewrite all workflows to use astral-sh/setup-uv and uv sync; drop poetry everywhere (Dockerfile, README, workflows) - Scope pip-audit ignores to vulnerabilities that are unfixable while alibi/alibi-detect cap pillow<11 and transformers<5, and cycquery caps pyarrow<18 Code fixes for new versions: - sklearn 1.7: precision_recall_curve keyword probas_pred -> y_score - torch 2.9+: index with a tuple of slices in torch_distributed - mypy 1.x updates: remove stale type-ignores, untyped-decorator code, import PIL.Image explicitly, restructure MetricCollection.add_metrics - tests: make OMOP querier construction lazy so importing test_slicer no longer requires a database; use a local RNG in _inject_ignore_index so results don't depend on execution order Full pre-commit suite (ruff, mypy, doctest, nbstripout, pytest: 9879 passed) is green locally. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Fix workflow issues: pin setup-uv to exact tag, skip docker push on PRs astral-sh/setup-uv publishes no bare v8 major tag, so pin v8.3.2. The docker workflow now only logs in and pushes outside pull requests; PR runs still build the image for validation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Fix remaining CI failures: flaky rank assertion, uv run re-sync, Dockerfile apt package - test_torch_distributed: pool.map does not pin task index to the worker's distributed rank, so assert the rank is valid instead of equal to the task index - unit tests workflow: use 'uv run --no-sync' so pytest does not re-sync with default groups; also set default-groups = [] so the dev group (which includes CUDA-only cupy) is opt-in, matching the old poetry behavior - Dockerfile: drop software-properties-common, which no longer exists in Debian trixie and was unused Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Problem
filter_datetime(..., day=...)currently reads the year component when applying the day filter, so day-of-month slicing can incorrectly return no matches.Fix
Use
pc.day(...)for thedaybranch and add a focused unit test for day-of-month filtering.Validation
Note: I used
datasets==2.21.0locally to match the repository's Poetry constraint range and avoid newerdatasetsAPI drift.