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: Series.pad has template variables that are not replaced #39640

Closed
jorisvandenbossche opened this issue Feb 7, 2021 · 9 comments · Fixed by #39978
Closed

DOC: Series.pad has template variables that are not replaced #39640

jorisvandenbossche opened this issue Feb 7, 2021 · 9 comments · Fixed by #39978
Assignees
Milestone

Comments

@jorisvandenbossche
Copy link
Member

When looking at the docstring of pad:

In [21]: pd.Series.pad?
Signature:
pd.Series.pad(
    self: 'FrameOrSeries',
    axis=None,
    inplace: 'bool_t' = False,
    limit=None,
    downcast=None,
) -> 'Optional[FrameOrSeries]'
Docstring:
Synonym for :meth:`DataFrame.fillna` with ``method='ffill'``.

Returns
-------
{klass} or None
    Object with missing values filled or None if ``inplace=True``.

Or on the online version: https://pandas.pydata.org/docs/dev/reference/api/pandas.Series.pad.html

There is a {klass} that has not been properly substituted.

@dylanp-git
Copy link
Contributor

Hi I'm not new to programming and have been in the professional space for over a year now but I have not made an open source contribution before.

I am happy to do this but the milestone seems to be due Today? If that is the case, I'll look for another "good first issue" issue. In the meantime I'll have a read of https://pandas-docs.github.io/pandas-docs-travis/development/contributing.html#where-to-start

@MarcoGorelli
Copy link
Member

Hi @dylanp-git - here's the contributing guide, I think the link you posted is to an old version

I'm not sure why this was added to the 1.2.2 milestone, I'm guessing it was meant to be 1.3 - either way, pretty sure it's not due today. I've assigned the issue to you, though in the future you can comment "take" and a bot will assign you

@dylanp-git
Copy link
Contributor

Thanks @MarcoGorelli - I'll start looking into this.

@jorisvandenbossche
Copy link
Member Author

Yes, to be clear, there is no hurry in doing this (it doesn't need to be done today or tomorrow).

@simonjayhawkins
Copy link
Member

moving to 1.2.3

@simonjayhawkins simonjayhawkins modified the milestones: 1.2.2, 1.2.3 Feb 8, 2021
@aryanxk02
Copy link

Thanks @MarcoGorelli - I'll start looking into this.

Hi @dylanp-git, could you tell me what exactly is the issue?? I tried tweaking it but couldn't understand it though. Thanks!

@dylanp-git
Copy link
Contributor

Hi,

I'm not sure exactly what's the issue yet. I'm trying to understand the generic.py file - so far I understand @doc() substitutes things like "klass" in the documentation and I assume @final means its already in its final form and therefore no substitution?

The ffill() function (which seems to be the source for Series.pad, in generic.py) has a @final tag rather than @doc() which makes me think that is the reason why {klass} is not being substituted.

I changed ffill() function to use @doc(klass=_shared_doc_kwargs["klass"]) and built the html for Series.pad inside the docker container. This is what I see:

image

Can anyone confirm what Series.pad is meant to return?

If ffill() should have the @final tag then another solution could be to hardcode what it should return in place of "{klass}".

@MarcoGorelli
Copy link
Member

MarcoGorelli commented Feb 17, 2021

@dylanp-git that looks right to me

Regarding

If ffill() should have the @Final tag

I don't think you need to remove the final decorator, you should be able to put both (e.g. mask from the same file has both @final and @doc)

I assume @Final means its already in its final form and therefore no substitution?

It just means the method can't be overridden, see mypy docs on final

@MarcoGorelli
Copy link
Member

MarcoGorelli commented Feb 18, 2021

closed via #39869


Sorry wrong issue, ignore me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants