test: pin invalid timezone error on EncounterRecencyTransformer - #222
Closed
HarshRajSinghania wants to merge 1 commit into
Closed
HarshRajSinghania wants to merge 1 commit into
HarshRajSinghania wants to merge 1 commit into
Conversation
Closes PhilanthroPy-Project#204. Signed-off-by: Harsh Raj Singhania <harshrajsinghania@proton.me>
Contributor
|
Closing this as a duplicate: #204 was claimed by @Kaap10 on 2026-09-12 and confirmed on the issue the same day, and #221 has now merged as dba8cd5. That is the claim-before-PR rule from #187 working as intended, and it is on me that it is easy to miss: the claim is a comment on the issue rather than an assignee, so the issue looks unclaimed from the list view. Checking the issue thread before starting is the only reliable way right now. Nothing wrong with the test itself. If you want another, #50, #53 and #55 are all open with zero comments, so no claim to collide with:
Thanks for #216 and for this one. |
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.
Closes #204.
Summary
Adds a regression test so an invalid
timezone=onEncounterRecencyTransformerraisesKeyErrorthat names the zone. The pre-#202 fallback turned a bad zone intoTypeError("Already tz-aware"); this test would fail if that path returned.No production code change.
__init__still does not validatetimezone(sklearn convention noted in the issue).Motivation
#204:
tests/test_encounter_timezone.pyonly used valid timezones or none. The behaviour restored in #202 was unguarded.Implementation
test_encounter_recency_localises_to_a_non_utc_timezone.timezone="Not/AZone"and callfit_transform.pytest.raises(KeyError, match="Not/AZone")so both pandas 2 (pytz) and pandas 3 (zoneinfo) are covered without importing pytz.Already tz-aware.CHANGELOG.md[Unreleased]entry andCONTRIBUTORS.mdline, as required by the project.Testing
Intended local commands from the issue:
This environment could not install scikit-learn (PyPI 502), so the new test was not executed here. CI on this PR should run the file and the full matrix.