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

PR09 batch 4 #29466

Merged
merged 17 commits into from
Nov 8, 2019
Merged

PR09 batch 4 #29466

merged 17 commits into from
Nov 8, 2019

Conversation

HughKelley
Copy link
Contributor

chunk of #28602

@pep8speaks
Copy link

pep8speaks commented Nov 7, 2019

Hello @HughKelley! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2019-11-08 14:41:27 UTC

@HughKelley
Copy link
Contributor Author

I'm unsure how to format line 133 in pandas/io/excel/_base.py. flake8 is picking up the space argument required to correctly format the list being inserted as an inappropriate indent.

@WillAyd
Copy link
Member

WillAyd commented Nov 7, 2019

I'm unsure how to format line 133 in pandas/io/excel/_base.py. flake8 is picking up the space argument required to correctly format the list being inserted as an inappropriate indent.

What was the issue you faced previously?

@HughKelley
Copy link
Contributor Author

HughKelley commented Nov 7, 2019

What was the issue you faced previously?

Was adding indentation to the docstring while adding a period to a parameter description here: 020e253

it required changing the indentation argument to textwrap.fill() (inserted a list of NaN values into the string) from 4 spaces to 8 to match the rest of the string.

@WillAyd
Copy link
Member

WillAyd commented Nov 7, 2019

Hmm can you post the built HTML doc? Looks OK on stable docs wouldn't expect to have to change the indent

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_excel.html

@HughKelley
Copy link
Contributor Author

I was adding a period and thought the indentation should match throughout the string like below but if it's ok I'll undo that change.

example = (
    """
summary

Parameters
----------
parameter_1 :  str
    Description.
"""
)

changed to

example = (
    """
    summary

    Parameters
    ----------
    parameter_1 :  str
        Description.
    """
   )

@HughKelley
Copy link
Contributor Author

@WillAyd ./scripts/validate_docstrings.py wasn't picking up the period at the end of the use_cols parameter description.

Adding an indent to the doc_string as I did in 020e253 resolved that but required adding 4 more spaces to the separator argument in fill() which created the E131 hanging indent error

@WillAyd
Copy link
Member

WillAyd commented Nov 7, 2019

Are we talking about usecols or na_values? I think I'm confused as to the source.

In any case I think OK to tweak slightly to get it to pass validation (i.e. adding text after bullets, or something to the effect)

@datapythonista

@WillAyd WillAyd added the Docs label Nov 7, 2019
@HughKelley
Copy link
Contributor Author

Are we talking about usecols or na_values? I think I'm confused as to the source.

The original error i was trying to fix was the a missing period for use_cols. I fixed that by indenting the string. that created a new error in na_values where in order to format the list correctly I had to add spaces to the separator argument which flake8 was then picking up as a hanging indent.

- If 'raise', then invalid parsing will raise an exception
- If 'coerce', then invalid parsing will be set as NaT
- If 'ignore', then invalid parsing will return the input
Behaves as:
Copy link
Member

Choose a reason for hiding this comment

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

Was this required to get validation to work?

Copy link
Member

Choose a reason for hiding this comment

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

You can remove all this. The new version of the script doesn't fail if the description starts with a list. And we'll move to the new version of the script soon.

@WillAyd WillAyd added this to the 1.0 milestone Nov 7, 2019
Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

lgtm @datapythonista if you care to take a look

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

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

Thanks @HughKelley, really nice PR.

Just a typo, and some additions that are not necessary, other than that looks perfect.

The output type will the be same as 'left', if it is a subclass
of DataFrame.
DataFrame
The merged DataFrame The output type will the be same as
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
The merged DataFrame The output type will the be same as
The merged DataFrame output type will the be same as

- If 'raise', then invalid parsing will raise an exception
- If 'coerce', then invalid parsing will be set as NaT
- If 'ignore', then invalid parsing will return the input
Behaves as:
Copy link
Member

Choose a reason for hiding this comment

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

You can remove all this. The new version of the script doesn't fail if the description starts with a list. And we'll move to the new version of the script soon.

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

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

If you want to remove the remaining Behaves as: and Behavior: that would be great, but lgtm

@HughKelley
Copy link
Contributor Author

If you want to remove the remaining Behaves as: and Behavior: that would be great, but lgtm

ah thanks

@HughKelley
Copy link
Contributor Author

@WillAyd and @datapythonista checks are green. Thanks very much for the help on this one!

@datapythonista datapythonista merged commit 1f2805b into pandas-dev:master Nov 8, 2019
@datapythonista
Copy link
Member

Thanks a lot for helping fix the documentation @HughKelley

Reksbril pushed a commit to Reksbril/pandas that referenced this pull request Nov 18, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
@HughKelley HughKelley deleted the PR09_batch_4 branch January 6, 2020 16:47
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.

4 participants