Skip to content

DOC: fix code-block in the reshaping docs #28838

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

Merged
merged 10 commits into from
Oct 16, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update reshaping.rst
  • Loading branch information
oktaysabak committed Oct 8, 2019
commit a68ed06e79ec4f03def9ff88f5a31c0a69b1e590
2 changes: 1 addition & 1 deletion doc/source/user_guide/reshaping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ Suppose we wanted to pivot ``df`` such that the ``col`` values are columns,
``row`` values are the index, and the mean of ``val0`` are the values? In
particular, the resulting DataFrame should look like:

.. code::
.. code-block:: html
Copy link
Member

Choose a reason for hiding this comment

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

This should not be highlighted as html. I think you can probably use just :: instead for having a code block without any highlighting.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello Joris, when I use without highlighting checks failing on AzureDevops because flake8-rst giving E999 syntax error. You should break a 'space' after "::", but when I break a space the end of line, ci/code_checks.sh gives linting error. The AzureDevops fails again.

Copy link
Member

Choose a reason for hiding this comment

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

I think you should remove the .. code-block:: html line, and in the previous have should look like:: (see the double colon).

If that doesn't work, try .. code-block:: text or .. code-block:: none

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay I will change it to .. code-block::
You will see the AzureDevops fail on flake8-rst

Copy link
Member

Choose a reason for hiding this comment

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

I guess the default for code-block is Python, and flake-rst is validating the content of the block assuming it's Python code, hence the syntax error.

In any case, can you implement one of the proposed options @oktaysabak please. Not so important to understand the details of the problem, let's simply fix it and get this merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes flake8-rst wants a ' ' blank after .. code-block:: like this. But if I leave a blank end of line; pandas code checker fails.( ci/code_checks.sh ) So I will change it to the .. code-block:: text than I will test it locally. I hope it will fix.


col col0 col1 col2 col3 col4
row
Expand Down