Skip to content

Conversation

@cmp0xff
Copy link
Contributor

@cmp0xff cmp0xff commented Nov 27, 2025

@cmp0xff cmp0xff marked this pull request as draft November 30, 2025 17:23
@cmp0xff cmp0xff mentioned this pull request Nov 30, 2025
1 task
cmp0xff added a commit to cmp0xff/pandas-stubs that referenced this pull request Nov 30, 2025
Copy link
Member

@loicdiridollou loicdiridollou left a comment

Choose a reason for hiding this comment

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

Two minor things so I understand better, good otherwise!


@pytest.mark.parametrize(("dtype", "target_dtype"), TYPE_FLOAT_ARGS.items())
def test_constructor_dtype(dtype: FloatDtypeArg, target_dtype: type) -> None:
def test_constructor_dtype(dtype: "FloatDtypeArg", target_dtype: type) -> None:
Copy link
Member

Choose a reason for hiding this comment

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

What is the change in behavior so that we need to put this in quotes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually unnecessary, 3a50508

tests/_typing.py Outdated
@@ -0,0 +1,84 @@
# Committed content should be import-only. At runtime of tests, this file will
# be replaced by pandas-stubs/_typing.pyi.
Copy link
Member

Choose a reason for hiding this comment

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

How is this replacement going to work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Explained in more detail in d6c22b7

This file serves as a stub file for static type checkers (pyright does not like it if I call the file tests/_typing.pyi).

In tests/conftest.py, this file is copied to tests/_typing.pyi, and pandas-stubs/_typing.pyi is copied to tests/_typing.py.

After tests are done, tests/_typing.pyi is copied back to pandas-stubs/_typing.pyi.

@loicdiridollou
Copy link
Member

(sorry I may have accidentally closed the PR)

@cmp0xff cmp0xff marked this pull request as ready for review November 30, 2025 22:52
Copy link
Member

@loicdiridollou loicdiridollou left a comment

Choose a reason for hiding this comment

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

All good, thanks a lot @cmp0xff!

@loicdiridollou loicdiridollou merged commit c616fb5 into pandas-dev:main Nov 30, 2025
16 checks passed
@cmp0xff cmp0xff deleted the feature/cmp0xff/1503 branch December 1, 2025 08:13
cmp0xff added a commit that referenced this pull request Dec 1, 2025
* GH1432 Partial resolution

* GH1432 PR Feedback

* type Index methods: putmask, asof, asof_locs, sort_values, get_indexer_non_unique, get_indexer_for, map, get_slice_bound (#1505)

* type Index methods: putmask, asof, asof_locs, sort_values, get_indexer_non_unique, get_indexer_for, map, get_slice_bound

* remove redundant `IntervalIndexer.get_indexer_non_unique`

* slice_locs can return either `np.integer` or `int`

* fix slice_locs test

* Apply suggestions from code review

Co-authored-by: Yi-Fan Wang <cmp0xff@users.noreply.github.com>

* np.integer -> np.intp

* test more mask types for `putmask`

* Apply suggestions from code review

Co-authored-by: Yi-Fan Wang <cmp0xff@users.noreply.github.com>

* test asof with str

---------

Co-authored-by: Yi-Fan Wang <cmp0xff@users.noreply.github.com>

* GH1432 PR Feedback

* FIX: #1508 numpy 1darrays in tests (#1512)

fix: #1508 numpy arrays in tests

* GH1484 Upgrade ty (#1509)

* GH1484 Upgrade ty

* GH1484 Fix formatting

* GH1484 Update PR

* GH1432 Partial resolution

* GH1432 PR Feedback

* Update tests/test_timefuncs.py

Co-authored-by: Yi-Fan Wang <cmp0xff@users.noreply.github.com>

---------

Co-authored-by: Marco Edward Gorelli <33491632+MarcoGorelli@users.noreply.github.com>
Co-authored-by: Yi-Fan Wang <cmp0xff@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove duplication of dtype/astype arguments between _typing.pyi and tests/__init__.py

2 participants