Skip to content

Conversation

@sanrishi
Copy link
Contributor

@sanrishi sanrishi commented Jan 22, 2026

This PR fixes the type aliases documentation to use proper Sphinx directives instead of references.

Changes

  • Replace :py:type: references with .. py:type:: directives
  • This makes the type aliases available in the intersphinx inventory
  • Allows external projects to link to these type aliases using Sphinx's :type: role

Removed outdated documentation section and fixed broken Sphinx reference targets.
Added a warning not to use a specific section in the documentation.
@Dr-Irv
Copy link
Contributor

Dr-Irv commented Jan 23, 2026

/preview

@github-actions
Copy link
Contributor

Website preview of this PR available at: https://pandas.pydata.org/preview/pandas-dev/pandas/63812/

@Dr-Irv
Copy link
Contributor

Dr-Irv commented Jan 23, 2026

So if you look at the preview at https://pandas.pydata.org/preview/pandas-dev/pandas/63812/docs/reference/aliases.html#module-pandas.api.typing.aliases and the published version at https://pandas.pydata.org/docs/dev/reference/aliases.html

you'll see that the changes have lost the aspect of this being in a table. I don't know if there is a way to preserve that. Can you find out?

@flying-sheep
Copy link
Contributor

Maybe possible with list tables? https://docutils.sourceforge.io/docs/ref/rst/directives.html#list-table

@sanrishi
Copy link
Contributor Author

/preview

@flying-sheep
Copy link
Contributor

What are you doing? As said, .. module:: is correct. Leave that.

@sanrishi
Copy link
Contributor Author

oh bro why your sheeps eyes are looking red now
wait i'll revert

@flying-sheep
Copy link
Contributor

Lol, I’ve just spent wayy too much time debugging Sphinx docs. I’m usually not sad, I just just know that I'm often the only guy around who knows how everything works together.

That's why I sometimes just say “do this thing”: because I know it's the only thing that makes sense.

@sanrishi
Copy link
Contributor Author

@flying-sheep There is 2:00 am here i forget to see time 😅
i will fix it tomorrow

Updated the typing aliases documentation to include a list table format for better readability and added descriptions for each alias.
@flying-sheep
Copy link
Contributor

flying-sheep commented Jan 24, 2026

Why do you keep removing .. module::?

Is that some kind of joke or are you trying to do something specific?

Because if you're trying to do something then ask and I can help. I assure you that deleting .. module:: will not be part of the solution, so stop doing that.

@sanrishi
Copy link
Contributor Author

@flying-sheep bro I applied you table logic and forget to change the module
Wait I'll convert it to module

Removed multiple argument type definitions for various methods and added a duplicate entry for XMLParsers.
@sanrishi
Copy link
Contributor Author

/preview

@github-actions
Copy link
Contributor

Website preview of this PR available at: https://pandas.pydata.org/preview/pandas-dev/pandas/63812/

@sanrishi
Copy link
Contributor Author

@flying-sheep after reading your table docs content i knew that sphinx is so strict with reStructuredText so i reStructured some texts to see if that works

Comment on lines 28 to 30
.. list-table::
:widths: 30 70
:header-rows: 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Why can't we continue to use the markdown table with ===== as we do through most of the pandas docs?

Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't check but as said multiple times, rST has a lot of implicit rules about where it accepts inline syntax, block syntax, both, or neither.

I assume table syntax might only support inline syntax and not block syntax, and directives are block syntax.

But as said, that's only an assumption based on the PR author not using table syntax.

* - Alias
- Meaning
* -
.. py:type:: AggFuncType
Copy link
Contributor

Choose a reason for hiding this comment

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

When this is rendered it looks like:

type pandas.api.typing.aliases.AggFuncType

The module pandas.api.typing.aliases is quite redundant for every entry. Is there a way that could be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok thanks for clarification i think two backtick method will work by changing the module back to current module

Copy link
Contributor

@flying-sheep flying-sheep Jan 24, 2026

Choose a reason for hiding this comment

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

No, double backticks mean “this is code”. There point of this PR is to create reference targets.

In reference roles, using ~ will leave out the redundant part, but I'm not sure if it's possible to shorten here.

@sanrishi
Copy link
Contributor Author

/preview

@github-actions
Copy link
Contributor

Website preview of this PR available at: https://pandas.pydata.org/preview/pandas-dev/pandas/63812/

@sanrishi
Copy link
Contributor Author

/preview

@github-actions
Copy link
Contributor

Website preview of this PR available at: https://pandas.pydata.org/preview/pandas-dev/pandas/63812/

@sanrishi
Copy link
Contributor Author

/preview

@github-actions
Copy link
Contributor

Website preview of this PR available at: https://pandas.pydata.org/preview/pandas-dev/pandas/63812/

@sanrishi
Copy link
Contributor Author

@Dr-Irv is that good now ?

@sanrishi
Copy link
Contributor Author

@Dr-Irv @flying-sheep any difficulty to review this?

@Dr-Irv
Copy link
Contributor

Dr-Irv commented Jan 25, 2026

/preview

@github-actions
Copy link
Contributor

Website preview of this PR available at: https://pandas.pydata.org/preview/pandas-dev/pandas/63812/

Copy link
Contributor

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

the imports only work from pandas.api.typing.aliases

@sanrishi sanrishi requested a review from Dr-Irv January 25, 2026 18:37
Copy link
Contributor

@flying-sheep flying-sheep left a comment

Choose a reason for hiding this comment

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

I have no clue why you keep breaking this. It must be this:

.. module:: pandas.api.typing.aliases

and the table needs to look like this

==================================== ================================================================
Alias                                Meaning
==================================== ================================================================
.. type:: AggFuncType                Type of functions that can be passed to :meth:`agg` methods
.. type:: AlignJoin                  Argument type for ``join`` in :meth:`DataFrame.join`

just do both of these things and the PR actually does what it says.

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.

DOC: add py:type reference targets to each entry in pandas.api.typing.aliases

3 participants