Skip to content

DOC: Fixing EX01 - Added examples #54210

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 5 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 0 additions & 6 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
pandas.errors.PyperclipWindowsException \
pandas.errors.UnsortedIndexError \
pandas.errors.UnsupportedFunctionCall \
pandas.test \
pandas.NaT \
pandas.read_feather \
pandas.read_orc \
pandas.read_sas \
pandas.read_spss \
pandas.read_sql_query \
pandas.io.stata.StataReader.data_label \
pandas.io.stata.StataReader.value_labels \
pandas.io.stata.StataReader.variable_labels \
Expand Down
4 changes: 4 additions & 0 deletions pandas/io/feather_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ def read_feather(
Returns
-------
type of object stored in file

Examples
--------
>>> df = pd.read_feather("path/to/file.feather") # doctest: +SKIP
"""
import_optional_dependency("pyarrow")
from pyarrow import feather
Expand Down
4 changes: 4 additions & 0 deletions pandas/io/orc.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ def read_orc(
a ``pyarrow.fs`` filesystem will be attempted to read the file. You can also pass a
pyarrow or fsspec filesystem object into the filesystem keyword to override this
behavior.

Examples
--------
>>> result = pd.read_orc("example_pa.orc") # doctest: +SKIP
"""
# we require a newer version of pyarrow than we support for parquet

Expand Down
4 changes: 4 additions & 0 deletions pandas/io/sas/sasreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ def read_sas(
-------
DataFrame if iterator=False and chunksize=None, else SAS7BDATReader
or XportReader

Examples
--------
>>> df = pd.read_sas("sas_data.sas7bdat") # doctest: +SKIP
"""
if format is None:
buffer_error_msg = (
Expand Down
4 changes: 4 additions & 0 deletions pandas/io/spss.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ def read_spss(
Returns
-------
DataFrame

Examples
--------
>>> df = pd.read_spss("spss_data.sav") # doctest: +SKIP
"""
pyreadstat = import_optional_dependency("pyreadstat")
check_dtype_backend(dtype_backend)
Expand Down
7 changes: 7 additions & 0 deletions pandas/io/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,13 @@ def read_sql_query(
-----
Any datetime values with time zone information parsed via the `parse_dates`
parameter will be converted to UTC.

Examples
--------
>>> from sqlalchemy import create_engine # doctest: +SKIP
>>> engine = create_engine("sqlite:///database.db") # doctest: +SKIP
>>> with engine.connect() as conn, conn.begin(): # doctest: +SKIP
... data = pd.read_sql_table("data", conn) # doctest: +SKIP
"""

check_dtype_backend(dtype_backend)
Expand Down
5 changes: 5 additions & 0 deletions pandas/util/_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ def test(extra_args: list[str] | None = None, run_doctests: bool = False) -> Non
Whether to only run the Python and Cython doctests. If you would like to run
both doctests/regular tests, just append "--doctest-modules"/"--doctest-cython"
to extra_args.

Examples
--------
>>> pd.test() # doctest: +SKIP
running: pytest...
Comment on lines +31 to +32
Copy link
Member

Choose a reason for hiding this comment

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

definitely a good idea to skip this one 😄

"""
pytest = import_optional_dependency("pytest")
import_optional_dependency("hypothesis")
Expand Down