Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: documentation rendering issue for functions using typing overloads #37239

Closed
shaido987 opened this issue Oct 19, 2020 · 3 comments
Closed
Labels
Docs Upstream issue Issue related to pandas dependency

Comments

@shaido987
Copy link
Contributor

Location of the documentation

https://pandas.pydata.org/docs/dev/reference/api/pandas.concat.html

Documentation problem

This is how the method header looks for concat:

pandas.concat(objs: Union[Iterable[‘DataFrame’], Mapping[Label, ‘DataFrame’]], axis='0', join: str = "'outer'", 
ignore_index: bool = 'False', keys='None', levels='None', names='None', verify_integrity: bool = 'False', 
sort: bool = 'False', copy: bool = 'True') → ’DataFramepandas.concat(objs: Union[Iterable[FrameOrSeries], Mapping[Label, FrameOrSeries]], axis='0', join: str = "'outer'", 
ignore_index: bool = 'False', keys='None', levels='None', names='None', verify_integrity: bool = 'False', 
sort: bool = 'False', copy: bool = 'True') → FrameOrSeriesUnion

For comparison, this is merge:

pandas.merge(left, right, how='inner', on=None, left_on=None, right_on=None, left_index=False, 
right_index=False, sort=False, suffixes='_x', '_y', copy=True, indicator=False, validate=None)

As can be seen above, concat keeps the type information and there are two entries (likely due to the different output types).

I'm not sure why this occurs, but there are several overloaded methods in the code which could be related:

@overload
def concat(
objs: Union[Iterable["DataFrame"], Mapping[Label, "DataFrame"]],
axis=0,
join: str = "outer",
ignore_index: bool = False,
keys=None,
levels=None,
names=None,
verify_integrity: bool = False,
sort: bool = False,
copy: bool = True,
) -> "DataFrame":
...
@overload
def concat(
objs: Union[Iterable["NDFrame"], Mapping[Label, "NDFrame"]],
axis=0,
join: str = "outer",
ignore_index: bool = False,
keys=None,
levels=None,
names=None,
verify_integrity: bool = False,
sort: bool = False,
copy: bool = True,
) -> FrameOrSeriesUnion:
...
def concat(
objs: Union[Iterable["NDFrame"], Mapping[Label, "NDFrame"]],
axis=0,
join="outer",
ignore_index: bool = False,
keys=None,
levels=None,
names=None,
verify_integrity: bool = False,
sort: bool = False,
copy: bool = True,
) -> FrameOrSeriesUnion:

@shaido987 shaido987 added Docs Needs Triage Issue that has not been reviewed by a pandas team member labels Oct 19, 2020
@shaido987 shaido987 changed the title DOC: concat documentation redering issue DOC: concat documentation rendering issue Oct 19, 2020
@jorisvandenbossche jorisvandenbossche removed the Needs Triage Issue that has not been reviewed by a pandas team member label Oct 19, 2020
@jorisvandenbossche
Copy link
Member

@shaido987 thanks a lot for the report. Those overloads should indeed not be shown. This seems to be a bug in sphinx, see sphinx-doc/sphinx#7785

In general, also see #33025 for showing type annotations in the docs or not.

@jorisvandenbossche jorisvandenbossche changed the title DOC: concat documentation rendering issue DOC: documentation rendering issue for functions using typing overloads Oct 19, 2020
@simonjayhawkins
Copy link
Member

Thanks @shaido987

we were aware of this, see #36475 (comment), but that is obviously not so visible as a dedicated issue.

But at the same time, i'm also happy to close this as it is a sphinx issue.

@simonjayhawkins simonjayhawkins added the Closing Candidate May be closeable, needs more eyeballs label Oct 19, 2020
@jorisvandenbossche jorisvandenbossche added Upstream issue Issue related to pandas dependency and removed Closing Candidate May be closeable, needs more eyeballs labels Dec 23, 2020
@jorisvandenbossche
Copy link
Member

The sphinx bug has been fixed in sphinx 3.3, so the latest docs also show this correctly now, see eg https://pandas.pydata.org/pandas-docs/version/1.2.0/reference/api/pandas.concat.html vs https://pandas.pydata.org/pandas-docs/version/1.1.0/reference/api/pandas.concat.html

So I think we can close it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Upstream issue Issue related to pandas dependency
Projects
None yet
Development

No branches or pull requests

3 participants