feat: support current-team filtering in load_teams - #63
Open
ArtMoreno wants to merge 1 commit into
Open
Conversation
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.
load_teams()currently returns historical and alternate team abbreviations and does not accept thecurrentargument available in nflreadr. Addcurrent: bool = True, matching the R implementation's default and its use of the existingteam_abbr_mappingvalues.Closes #48.
With the live team dataset checked September 9, 2026:
The current dataset's excluded abbreviations are
LAR,OAK,SD, andSTL; the standardized Rams abbreviation isLA. Filtering derives from the bundled mapping, not a hardcoded list or team count. The downloaded/cached frame is preserved for callers requesting all entries.Changes
src/nflreadpy/load_teams.py: optional filter using the existing mapping; document the argument and default.tests/test_integration.py: regression coverage for default, explicit true, and false; check row order, metadata, and preservation of the unfiltered frame.CHANGELOG.md: explain the new default and thecurrent=Falsemigration path.Validation
Native Windows, Python 3.11.15; locked development dependencies.
python -m pytest tests -v: 51 passed, including live-data integration tests.utils_date.pymissing-annotation warning remains.git diff --check: pass.mypy src: 5 errors in unchangeddatasets.pyandutils_date.py. Repeating mypy with the originalload_teams.pyproduces the same 5 errors; no new errors from this patch.Base:
c54316e16fb6cbbfbc52ed2a9c07fca070a0c636.No overlapping PR appeared in the all-state
current load_teamssearch. This deliberately changes the no-argument default to match nflreadr; callers needing historical/alternate rows should passcurrent=False.Prepared with Codex assistance; all reported tests were run locally.