Skip to content

DOC: Avoid requesting data from s3 buckets from our docs #56762

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

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.head(1)
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't the file contain only one row already? I see that now we simply show df and the output is the same. Am I missing something?

Suggested change
>>> df.head(1)
>>> df

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed it's redundant. Will revise now.

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