Skip to content

Commit

Permalink
DOC: Fix docstrings api.types.pandas_dtype (#60319)
Browse files Browse the repository at this point in the history
* add api.types.pandas_dtype PR07, RT03, SA01 docstrings

* remove from code_checks.sh

* edit see also

---------

Co-authored-by: root <[email protected]>
  • Loading branch information
ensalada-de-pollo and root authored Nov 15, 2024
1 parent 12d6f60 commit 3895156
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 0 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Timestamp.resolution PR02" \
-i "pandas.Timestamp.tzinfo GL08" \
-i "pandas.api.types.is_re_compilable PR07,SA01" \
-i "pandas.api.types.pandas_dtype PR07,RT03,SA01" \
-i "pandas.arrays.ArrowExtensionArray PR07,SA01" \
-i "pandas.arrays.IntegerArray SA01" \
-i "pandas.arrays.IntervalArray.length SA01" \
Expand Down
8 changes: 7 additions & 1 deletion pandas/core/dtypes/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1785,16 +1785,22 @@ def pandas_dtype(dtype) -> DtypeObj:
Parameters
----------
dtype : object to be converted
dtype : object
The object to be converted into a dtype.
Returns
-------
np.dtype or a pandas dtype
The converted dtype, which can be either a numpy dtype or a pandas dtype.
Raises
------
TypeError if not a dtype
See Also
--------
api.types.is_dtype : Return true if the condition is satisfied for the arr_or_dtype.
Examples
--------
>>> pd.api.types.pandas_dtype(int)
Expand Down

0 comments on commit 3895156

Please sign in to comment.