Skip to content

Conversation

@yasumorishima
Copy link

Closes #63191.

The name parameter in Index.to_frame had two inaccuracies in its docstring:

  • Type was documented as object, but the actual type annotation is Hashable
  • Default was described as index.name, but the actual default is lib.no_default

Fixed both and added a clarifying sentence about the fallback behavior.

The `name` parameter's type was documented as `object` but the actual
type annotation is `Hashable`. The default value was described as
`index.name` but the actual default is `lib.no_default`.

Closes pandas-dev#63191

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Set the index of the returned DataFrame as the original Index.

name : object, defaults to index.name
name : Hashable, default lib.no_default
Copy link
Member

Choose a reason for hiding this comment

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

lib.no_default is a meaningless (to users) sentinel value to mean the default behaviour, and should not be used in the explanation. I think the current wording is fine. Or if we want to use something else, it could be , optional (to indicate it is optional to specify the argument, while the method still has some default behaviour when it is not specified)

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for the review. You're right — \ is an internal sentinel and shouldn't appear in user-facing docs. I've reverted the default description to the original wording and kept only the type change (\ → ).

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for the review. You are right, lib.no_default is an internal sentinel and should not appear in user-facing docs. I have reverted the default description to the original wording and kept only the type change (object to Hashable).

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for the review. You are right, lib.no_default is an internal sentinel and should not appear in user-facing docs. I have reverted the default description to the original wording and kept only the type change (object to Hashable).

yasumorishima and others added 3 commits February 11, 2026 22:45
Address review: lib.no_default is an internal sentinel, not for user docs.
Reverted default description to original "defaults to index.name".
Kept type change: object → Hashable.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DOC: name in Index.to_frame is claimed to default to index.name

2 participants