Skip to content

Update mypy version from 1.11.2 to 1.13.0 #60260

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

Merged
merged 33 commits into from
Nov 9, 2024

Conversation

dl-lim
Copy link
Contributor

@dl-lim dl-lim commented Nov 9, 2024

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

@simonjayhawkins simonjayhawkins added Typing type annotations, mypy/pyright type checking Sprints Sprint Pull Requests labels Nov 9, 2024
@dl-lim
Copy link
Contributor Author

dl-lim commented Nov 9, 2024

Man Group London Hackathon 2024

@simonjayhawkins

@ofsouzap
@nvasilev
@shengjie2013
@pyfra
@YasithDSL
@dl-lim

nvasilev and others added 26 commits November 9, 2024 12:36
Fix typing error casting `._values` to a `DataFrame` in `pandas.core.generic`
Removed a missed type ignore
`nanops.nanmedian` typing fix
@simonjayhawkins simonjayhawkins added this to the 3.0 milestone Nov 9, 2024
@@ -738,7 +740,7 @@ def nanmedian(values, *, axis: AxisInt | None = None, skipna: bool = True, mask=

Returns
-------
result : float
result : float | ndarray
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you comment in PR a example returning an array

Copy link
Contributor

@ofsouzap ofsouzap Nov 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, the following code would be an example of when the function would return an array, and not a float:

import pandas as pd
import numpy as np

pd.core.nanops.nanmedian(
  np.array([
    [1, 2, 3],
    [2, 3, 4]
  ],
  axis=1)
)

This code would output,

array([2., 3.])

@dl-lim dl-lim marked this pull request as ready for review November 9, 2024 19:35
Copy link
Member

@simonjayhawkins simonjayhawkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@simonjayhawkins simonjayhawkins merged commit 4fcee0e into pandas-dev:main Nov 9, 2024
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sprints Sprint Pull Requests Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants