Skip to content

Conversation

@rhshadrach
Copy link
Member

@rhshadrach rhshadrach commented Nov 4, 2025

  • 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.

It appears that if the __module__ value of the class does not agree with the __module__ value of the methods, then the doctests do not run.

Still verifying if this is correct and investigating the best way to handle it.

Edit: Indeed, CI is showing many wrong docstrings due to this.

There are two approaches I am considering here:

  1. Use an env variable similar to what this PR is currently doing to not set the __module__ values when we run the doctests. The downside is that we'd need to not have the __module__ value appear in any of the example's output because e.g. pandas.Series would appear as pandas.core.series.Series.
  2. Set the __module__ on all class methods via the set_module decorator using inspect (automatically iterating through class methods and modifying the __module__ attribute). This would increase import time (not sure by how much) and it wouldn't work on cdef classes.

@jbrockmendel
Copy link
Member

Yikes. I like the env variable approach more than then set_module-on-all-classmethods approach. Is there a "hope for a fix upstream" option?

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.

2 participants