Commit 0ddc312
authored
Make annotation for
* Make annotation for `.copy()` more precise
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.copy.html
says the return value's `Object type matches caller.`
Previously, this returned a `FrameOrSeries` which was less ergonomic.
Without this fix, the newly added tests fail:
```
(venv3) aagrawal@aagrawal-mbp151 ~/src/pandas-stubs $ mypy --config-file mypy.ini third_party/3/pandas tests/snippets
tests/snippets/test_series.py:40: error: Incompatible types in assignment (expression has type "Union[DataFrame, Series]", variable has type "Series")
tests/snippets/test_frame.py:47: error: Incompatible types in assignment (expression has type "Union[DataFrame, Series]", variable has type "DataFrame")
Found 2 errors in 2 files (checked 241 source files)
```
* Bump version.copy() more precise (#42)1 parent fc2a0de commit 0ddc312
File tree
4 files changed
+15
-3
lines changed- tests/snippets
- third_party/3/pandas/core
4 files changed
+15
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
38 | 43 | | |
39 | 44 | | |
40 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
118 | | - | |
| 120 | + | |
119 | 121 | | |
120 | 122 | | |
121 | 123 | | |
| |||
0 commit comments