Skip to content

Commit 1af1030

Browse files
DOC: Avoid requesting data from s3 buckets from our docs (#56762)
* 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]>
1 parent f14893d commit 1af1030

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

doc/source/user_guide/io.rst

+9-8
Original file line numberDiff line numberDiff line change
@@ -1704,7 +1704,7 @@ option parameter:
17041704

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

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

0 commit comments

Comments
 (0)