-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: Add typing tests according to the issue 45252 #45594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
zkrolikowski-vl
wants to merge
32
commits into
pandas-dev:main
from
zkrolikowski-vl:enhancement/45252_typing_tests
Closed
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
66e4aed
Add typing tests according to the issue 45252.
zkrolikowski-vl 54773e5
README, isort, skip_if_no
zkrolikowski-vl 5bedab9
Configured isort for black profile
zkrolikowski-vl a58cd25
Configured isort for black profile
zkrolikowski-vl d2b55ab
Copyright notice, tempfile
zkrolikowski-vl 479b6bf
Remove redundant profile configuration
zkrolikowski-vl feb94b9
Missing matplotlib. Isort again
zkrolikowski-vl 4d1eefd
Isort
zkrolikowski-vl fc35975
Add typing tests according to the issue 45252.
zkrolikowski-vl 8d17f21
README, isort, skip_if_no
zkrolikowski-vl 1c32250
Configured isort for black profile
zkrolikowski-vl 47ae975
Configured isort for black profile
zkrolikowski-vl 16d21e5
Copyright notice, tempfile
zkrolikowski-vl e382af0
Remove redundant profile configuration
zkrolikowski-vl ff2d31b
Missing matplotlib. Isort again
zkrolikowski-vl 70902cc
Isort
zkrolikowski-vl 0d2b8f9
Windows error for tempfile
zkrolikowski-vl c0cc7d2
Isort
zkrolikowski-vl b1e0cef
Fix
zkrolikowski-vl 16918a1
Isort
zkrolikowski-vl 98b13d4
Merge branch 'master' into enhancement/45252_typing_tests
zkrolikowski-vl bd002eb
Removed use of tempfile
zkrolikowski-vl 6d965ee
Isort
zkrolikowski-vl 2ab9bfd
Remove deprecated usage. Type temporary paths
zkrolikowski-vl 4ec409f
Isort
zkrolikowski-vl 412c1dd
Merge branch 'master' into enhancement/45252_typing_tests
zkrolikowski-vl 8897541
Fixing CI issues
zkrolikowski-vl d1b134f
Fixed experimental data manager issues
zkrolikowski-vl b1a40ea
Merge branch 'main' into enhancement/45252_typing_tests
zkrolikowski-vl 8f0c217
Fixed invalid values return type for series
zkrolikowski-vl 20115ab
Merge branch 'main' into enhancement/45252_typing_tests
zkrolikowski-vl 4c36baf
Merge branch 'main' into enhancement/45252_typing_tests
zkrolikowski-vl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
## Purpose of those tests | ||
|
||
The tests contained in the `valid` directory are snippets that when | ||
process through a type checker ensure that type annotations and type | ||
stubs from this repository conform to common pandas API use-patterns. | ||
|
||
## Running the tests | ||
|
||
Tests can be run in following ways: | ||
|
||
`pyright pandas/tests/typing` | ||
|
||
`mypy pandas/tests/typing` | ||
|
||
They'll also be automatically detected and executed by pytest. This | ||
is to ensure that the test code itself is valid. | ||
|
||
## Developing the tests | ||
|
||
Some tests contain type checker ignore-instructions along with an | ||
error that's supposed to be thrown. | ||
|
||
# error: No overload variant of "to_datetime" matches argument type "DataFrame" | ||
pd.to_datetime(df) # type: ignore[call-overload] | ||
|
||
All such constructs are placed because of the missing/invalid API | ||
type information. When the API signature becomes valid again type | ||
checker will ask you to remove `type: ignore`. Please remove the | ||
above comment as well. | ||
|
||
When adding new tests please use the above solution as well. | ||
|
||
## Origins and attribution | ||
|
||
The tests come from the [pandas-stubs](https://github.com/VirtusLab/pandas-stubs) | ||
repository originally released under the MIT license. | ||
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shoyer You seem to often reply to license compatibility questions :)
Is it okay to integrate this MIT-licened code into pandas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pandas is happy to reuse MIT licensed code (e.g., see existing examples in https://github.com/pandas-dev/pandas/tree/main/LICENSES), but you absolutely need to preserve original copyright notices. The general rule (not sure if pandas is 100% strict about it, but it's a good practice) is to keep the original copyright notice as a top level comment inside each file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shoyer Should I include any open source contributors, who added their code since the library was originally created, in the copyright notice?