Skip to content

Commit

Permalink
DOC: Avoid requesting data from s3 buckets from our docs (#56762)
Browse files Browse the repository at this point in the history
* Update io.rst

Make consistent with other s3 bucket URL examples and avoid doc build error when problem with s3 url.

* Update io.rst

Make example consistent with other code block examples

* Update v2.3.0.rst

* immitating interactive mode

For each S3 bucket code block, ideally we show what the output would be, but without making an actual call. Unfortunately, for several of the S3 buckets, there are issues with the code, which we must fix in another commit or PR.

For now, the two S3 examples that do work, we edit to make the code block show what the output would have been if it had run successfully.

Find details on issues in conversation on PR #56592

* Update io.rst

Code still doesn't run, but at least unmatched } is no longer the issue.

* Update v2.3.0.rst

avoids unnecessary file change in PR

* Update io.rst

Rollback changes to one of the examples (out of scope)

* Update io.rst

* Update io.rst

---------

Co-authored-by: JackCollins1991 <[email protected]>
  • Loading branch information
JackCollins91 and JackCollins1991 authored Jan 15, 2024
1 parent f14893d commit 1af1030
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions doc/source/user_guide/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1704,7 +1704,7 @@ option parameter:

.. code-block:: python
storage_options = {"client_kwargs": {"endpoint_url": "http://127.0.0.1:5555"}}}
storage_options = {"client_kwargs": {"endpoint_url": "http://127.0.0.1:5555"}}
df = pd.read_json("s3://pandas-test/test-1", storage_options=storage_options)
More sample configurations and documentation can be found at `S3Fs documentation
Expand Down Expand Up @@ -3015,14 +3015,15 @@ Read in the content of the "books.xml" as instance of ``StringIO`` or
Even read XML from AWS S3 buckets such as NIH NCBI PMC Article Datasets providing
Biomedical and Life Science Jorurnals:

.. ipython:: python
:okwarning:
.. code-block:: python
df = pd.read_xml(
"s3://pmc-oa-opendata/oa_comm/xml/all/PMC1236943.xml",
xpath=".//journal-meta",
)
df
>>> df = pd.read_xml(
... "s3://pmc-oa-opendata/oa_comm/xml/all/PMC1236943.xml",
... xpath=".//journal-meta",
...)
>>> df
journal-id journal-title issn publisher
0 Cardiovasc Ultrasound Cardiovascular Ultrasound 1476-7120 NaN
With `lxml`_ as default ``parser``, you access the full-featured XML library
that extends Python's ElementTree API. One powerful tool is ability to query
Expand Down

0 comments on commit 1af1030

Please sign in to comment.