From f350ff67c2584583df0320506e3fe92f30179854 Mon Sep 17 00:00:00 2001 From: Yashpal Ahlawat Date: Sun, 25 Feb 2024 00:57:54 +0530 Subject: [PATCH 1/2] ES01 fix for HDFS Methods --- ci/code_checks.sh | 4 ---- pandas/io/pytables.py | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 47a2cf93a4f89..25bb691caed71 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -521,10 +521,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.DatetimeIndex.year\ pandas.DatetimeTZDtype.tz\ pandas.DatetimeTZDtype.unit\ - pandas.HDFStore.get\ - pandas.HDFStore.info\ - pandas.HDFStore.keys\ - pandas.HDFStore.put\ pandas.Index.T\ pandas.Index.all\ pandas.Index.any\ diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index c7ee1cac2e14a..4454df12d968f 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -640,6 +640,12 @@ def keys(self, include: str = "pandas") -> list[str]: """ Return a list of keys corresponding to objects stored in HDFStore. + The include parameter can be used to filter the returned + list based on the type of objects to include. If include + is set to "pandas" (default), only pandas objects will + be included in the list. If include is set to "native", + only native HDF5 Table objects will be included in the list. + Parameters ---------- @@ -776,6 +782,9 @@ def get(self, key: str): """ Retrieve pandas object stored in file. + This method within the context of a Pandas HDFStore allows + you to retrieve data that has been previously saved. + Parameters ---------- key : str @@ -1107,6 +1116,10 @@ def put( """ Store object in HDFStore. + It also offers options to control various aspects of the + storage process, such as whether to write DataFrame index + as a column, whether to remove missing values, etc. + Parameters ---------- key : str @@ -1647,6 +1660,10 @@ def info(self) -> str: """ Print detailed information on the store. + This method provide convenient ways to interact with data + stored in HDFStore files,allowing users to easily access + and inspect their content. + Returns ------- str From dae653ca01b04234a31eb6999efcd17c49cb1b04 Mon Sep 17 00:00:00 2001 From: Yashpal Ahlawat Date: Sun, 25 Feb 2024 13:44:28 +0530 Subject: [PATCH 2/2] review comments implemented --- pandas/io/pytables.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index 4454df12d968f..ccbf84e254940 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -640,10 +640,10 @@ def keys(self, include: str = "pandas") -> list[str]: """ Return a list of keys corresponding to objects stored in HDFStore. - The include parameter can be used to filter the returned - list based on the type of objects to include. If include + The ``include`` parameter can be used to filter the returned + list based on the type of objects to include. If ``include`` is set to "pandas" (default), only pandas objects will - be included in the list. If include is set to "native", + be included in the list. If ``include`` is set to "native", only native HDF5 Table objects will be included in the list. Parameters @@ -1660,8 +1660,8 @@ def info(self) -> str: """ Print detailed information on the store. - This method provide convenient ways to interact with data - stored in HDFStore files,allowing users to easily access + This method provides convenient ways to interact with data + stored in HDFStore files, allowing users to easily access and inspect their content. Returns