Skip to content

DOC: Enforce Numpy Docstring Validation for pandas.HDFStore.info #58368

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
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
1 change: 0 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.DatetimeTZDtype.tz SA01" \
-i "pandas.DatetimeTZDtype.unit SA01" \
-i "pandas.Grouper PR02" \
-i "pandas.HDFStore.info RT03,SA01" \
-i "pandas.HDFStore.keys SA01" \
-i "pandas.HDFStore.put PR01,SA01" \
-i "pandas.HDFStore.select SA01" \
Expand Down
15 changes: 12 additions & 3 deletions pandas/io/pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -1688,17 +1688,26 @@ def info(self) -> str:
Returns
-------
str
A String containing the python pandas class name, filepath to the HDF5
file and all the object keys along with their respective dataframe shapes.

See Also
--------
HDFStore.get_storer : Returns the storer object for a key.

Comment on lines +1693 to 1697
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mroeschke I could not find a closer method than this.

Examples
--------
>>> df = pd.DataFrame([[1, 2], [3, 4]], columns=["A", "B"])
>>> df1 = pd.DataFrame([[1, 2], [3, 4]], columns=["A", "B"])
>>> df2 = pd.DataFrame([[5, 6], [7, 8]], columns=["C", "D"])
>>> store = pd.HDFStore("store.h5", "w") # doctest: +SKIP
>>> store.put("data", df) # doctest: +SKIP
>>> store.put("data1", df1) # doctest: +SKIP
>>> store.put("data2", df2) # doctest: +SKIP
>>> print(store.info()) # doctest: +SKIP
>>> store.close() # doctest: +SKIP
<class 'pandas.io.pytables.HDFStore'>
File path: store.h5
/data frame (shape->[2,2])
/data1 frame (shape->[2,2])
/data2 frame (shape->[2,2])
"""
Comment on lines 1697 to 1711
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mroeschke I took the liberty to refine the example by adding one more dataframe. Let me know if this is good or I need to revert back.

Copy link
Member

Choose a reason for hiding this comment

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

Sure thanks for the addition

path = pprint_thing(self._path)
output = f"{type(self)}\nFile path: {path}\n"
Expand Down
Loading