-
-
Notifications
You must be signed in to change notification settings - Fork 143
Is there some obvious reason why api.typing
is not present in the api
interface stub?
#1221
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
Comments
@loicdiridollou need to add |
Ill add typing to the api init.
Furthermore the NaTType was exposed in the pandas repo after we added it to
the stubs repo so even if we were correct in pandas.api.__init__ it’d still
be an issue.
I’ll add it, fix it all and make sure we are not missing anything else.
Thanks for raising it!
…On Mon, May 19, 2025 at 8:32 AM Irv Lustig ***@***.***> wrote:
Assigned #1221 <#1221>
to @loicdiridollou <https://github.com/loicdiridollou>.
—
Reply to this email directly, view it on GitHub
<#1221 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMQNSQB5P4MRXX7AWQUTCY327HFNPAVCNFSM6AAAAAB5NTWFTSVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJXG4YTIMJWGU3DOMY>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
I just stumbled on a similar problem with |
Good catch, the question to @Dr-Irv is should we realign all those |
Hm, I didn't notice this at first, do you know the rationale behind this? I wanted to write something like this: def foo(df: pd.DataFrame) -> pandas.io.formats.style.Styler: but it fails with from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from pandas.io.formats.style import Styler
def colour_platform_column(df: pd.DataFrame) -> Styler: This is a bit cumbersome, maybe I'm missing something here? Docs don't mention the fact that you have to do such hacks. |
My take on this is that if the pandas source has an I think they would all need to be of the from |
Is there some obvious reason why
api.typing
is not present in theapi
interface stub?https://github.com/pandas-dev/pandas-stubs/blob/86073150f5e1b607c37a536ec99204ed21bad0cb/pandas-stubs/api/__init__.pyi
Was it missed in #1058?
I see
types
there but nottyping
, both are public interfaces according to docs.I just wanted to use
pandas.api.typing.NaTType
in my code but my static type checker complained thattyping
is not part ofpandas.api
.Originally posted by @Molkree in #1220
The text was updated successfully, but these errors were encountered: