-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
Conversation
oktaysabak
commented
Oct 8, 2019
•
edited by datapythonista
Loading
edited by datapythonista
- closes DOC: fix code-block in the reshaping docs #28819
- [ x] closes #28819
if I wrote only .. code-block:: it shows in github truly but its not passing tests,. so I select python language for code-block
When I review file It looks fixed but checks failing 😢 |
I think we should change ".. code-block::" to ".. code:: " so its about linting problem. |
This is a useful link |
I change the "space size before ". I hope it will pass the checks
Finally I found the solution. `E999 SyntaxError: invalid syntax causes flake8 to skip AST tests. Keep mandatory E999 issues in blocks with :flake8-group: Ignore to preserve full testing for the rest of the blocks.` [link is here](https://pypi.org/project/flake8-rst/)
Finally I found the solution. |
if I add a whitespace after .. code-block:: So I will change code-block to .. code:: If I convert it to I test it manually from my local computer. I hope it will work and I think this is a bug. |
doc/source/user_guide/reshaping.rst
Outdated
row2 0.13 NaN 0.395 0.500 0.25 | ||
row3 NaN 0.310 NaN 0.545 NaN | ||
row4 NaN 0.100 0.395 0.760 0.24 | ||
.. code-block:: html |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Thanks! Did you render the html? do you mind copying a screenshot to see how it looks? |
Yes I rendered it on my local machine. ( imgur was banned in Turkey. So I uploaded the screenshot to this site. ) |
row2 0.13 NaN 0.395 0.500 0.25 | ||
row3 NaN 0.310 NaN 0.545 NaN | ||
row4 NaN 0.100 0.395 0.760 0.24 | ||
.. code-block:: text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still dont' think this will format corectly; rather than trying to fix it this way, simply create a DataFrame and show it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially thought of doing so. but requested only 'change note
to the code-block
'. If you want I can change it to the DataFrame then call it on .. code-block:: ipython
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, does this actually render the same as a dataframe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created a example_dataframe variable. Result after rendering looks like this: link
If you OK, I can commit my changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created a example_dataframe variable. Result after rendering looks like this: link
If you OK, I can commit my changes
*i will write DataFrame values on original 'reshaping.rst' file, this values only for show render results.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jreback the point of this block in the docs is to show a possible result, and not an actual dataframe. The full section could maybe be rewritten, but that is outside of scope for this PR.
@oktaysabak Thanks for the screenshot! That's looking good, and CI is passing now ;) So merging, thanks again for your contribution! |
This is my first merge in a big project. Thank you ! |