Skip to content

Conversation

@tuhinsharma121
Copy link
Contributor

Fixes

pandas.tseries.offsets.CBMonthBegin PR02
pandas.tseries.offsets.CBMonthEnd PR02
pandas.tseries.offsets.CustomBusinessMonthBegin PR02
pandas.tseries.offsets.CustomBusinessMonthEnd PR02

Fixed the PR02 error for CBMonthBegin and CBMonthEnd by adding __signature__ attributes to these Cython classes.

Changes Made
File: pandas/_libs/tslibs/offsets.pyx

  • Added explicit __signature__ attributes for CBMonthBegin and CBMonthEnd classes
  • This allows Python's inspect.signature() to properly introspect these Cython classes
  • The signatures match the __init__ method parameters defined in the parent _CustomBusinessMonth class

Why This Fix Works

  • Root cause: Cython cdef class definitions don't expose their init signatures to Python's inspection tools
  • Solution: Manually set the signature attribute using inspect.Parameter and inspect.Signature
  • Result: The numpydoc validator can now verify that docstring parameters match the actual function signature

@sanrishi
Copy link
Contributor

sanrishi commented Jan 26, 2026

I already working on this @tuhinsharma121
That's why you are getting branch conflicts
See #63866 could you review that pr first ?

@tuhinsharma121 tuhinsharma121 force-pushed the pandas.tseries.offsets.CBMonthBegin branch from ee9ca1a to d186bfd Compare January 26, 2026 05:56
@tuhinsharma121
Copy link
Contributor Author

I forgot to rebase main on this branch, hence the conflict. resolved it. unmerged PRs dont create conflict for other PRs. Nevertheless, happy to close this PR.

@sanrishi
Copy link
Contributor

@tuhinsharma121 It's so helpfull for me if you review my Pr because you are too experienced in it
By the way are you from India?

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