feat(typing): Add complete typing to core operations (#3849)#4150
feat(typing): Add complete typing to core operations (#3849)#4150Paramveersingh-S wants to merge 5 commits into
Conversation
|
Hi @ikrommyd, First off, I sincerely apologize for the confusion regarding the You are completely right that adding a type hint to a single parameter is an incomplete fix. I have updated the PR title and pushed new commits that take a much larger step towards Hopefully, this serves as a solid foundation for |
|
We'd need some internal discussion about how to approach the issue and how we want to group PRs about adding typing. |
|
Open PRs related to issue #3980 add summary lines to the docstrings, one line below the function signatures this PR edits. That might cause merge conflicts. |
|
The docstrings are very very loosely related to typing and will not cause merge conflicts. They are only related by the fact that the docstrings describe the type in words but loosely. |
|
They are next to each other. Merge conflicts can occur if you try to merge two branches that edit two lines next to each other. |
|
Yet the one is changing docstrings while typing changes source code. |
"Thanks for the update! Take all the time you need for the internal discussion on how to best group the typing PRs. I'm happy to hold off on further changes, and if any merge conflicts pop up with #3980 down the line, I'll be more than happy to rebase and resolve them. Just let me know how you'd like to proceed when you're ready!" |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
|
Summary
Fixes issue #13 by adding the missing type hint for the
axisparameter inak.flatten.Problem
The type hint for
axiswas absent insrc/awkward/operations/ak_flatten.py, which caused static type checkers like Pyright to report errors whenak.flattenwas used. The docstring correctly notes it can beNone,int, orstr, but the signature was missing it.Solution
Added
axis: int | str | None = 1in the function signature to correctly define the supported types for theaxisargument, appeasing static type checkers.