Repository: pandas-dev/pandas
Pull request: Updated code_checks.sh with PR06
- [ ✔] closes #28724
- [ ] tests added / passed
- [✔ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [ ] whatsnew entry


Problem statement:
Fix PR06 issues in docstrings
Fix the docstrings where there is an error in a parameter format, eg string instead of str.
Current errors:
```
pandas.Series.to_json: Parameter "indent" type should use "int" instead of "integer"
pandas.Timestamp.ceil: Parameter "freq" type should use "str" instead of "string"
pandas.Timestamp.day_name: Parameter "locale" type should use "str" instead of "string"
pandas.Timestamp.floor: Parameter "freq" type should use "str" instead of "string"
pandas.Timestamp.month_name: Parameter "locale" type should use "str" instead of "string"
pandas.Timestamp.round: Parameter "freq" type should use "str" instead of "string"
pandas.Timedelta: Parameter "value" type should use "int" instead of "integer"
pandas.Timedelta: Parameter "value" type should use "str" instead of "string"
pandas.Timedelta.max: Parameter "value" type should use "int" instead of "integer"
pandas.Timedelta.max: Parameter "value" type should use "str" instead of "string"
pandas.Timedelta.min: Parameter "value" type should use "int" instead of "integer"
pandas.Timedelta.min: Parameter "value" type should use "str" instead of "string"
pandas.Timedelta.ceil: Parameter "freq" type should use "str" instead of "string"
pandas.Timedelta.floor: Parameter "freq" type should use "str" instead of "string"
pandas.Timedelta.round: Parameter "freq" type should use "str" instead of "string"
pandas.Period.asfreq: Parameter "freq" type should use "str" instead of "string"
pandas.Period.to_timestamp: Parameter "freq" type should use "str" instead of "string"
pandas.arrays.IntervalArray.from_arrays: Parameter "copy" type should use "bool" instead of "boolean"
pandas.arrays.IntervalArray.from_tuples: Parameter "copy" type should use "bool" instead of "boolean"
pandas.arrays.IntervalArray.from_breaks: Parameter "copy" type should use "bool" instead of "boolean"
pandas.arrays.IntervalArray.to_tuples: Parameter "na_tuple" type should use "bool" instead of "boolean"
pandas.Categorical.from_codes: Parameter "codes" type should use "int" instead of "integer"
pandas.Categorical.from_codes: Parameter "dtype" type should use "str" instead of "string"
pandas.SparseArray: Parameter "kind" type should use "int" instead of "integer"
pandas.read_table: Parameter "cache_dates" type should use "bool" instead of "boolean"
pandas.read_csv: Parameter "cache_dates" type should use "bool" instead of "boolean"
pandas.read_msgpack: Parameter "iterator" type should use "bool" instead of "boolean"
pandas.ExcelWriter: Parameter "path" type should use "str" instead of "string"
pandas.ExcelWriter: Parameter "engine" type should use "str" instead of "string"
pandas.ExcelWriter: Parameter "date_format" type should use "str" instead of "string"
pandas.ExcelWriter: Parameter "datetime_format" type should use "str" instead of "string"
pandas.read_json: Parameter "orient" type should use "str" instead of "string"
pandas.read_html: Parameter "flavor" type should use "str" instead of "string"
pandas.HDFStore.append: Parameter "append      " type should use "bool" instead of "boolean"
pandas.HDFStore.append: Parameter "min_itemsize" type should use "str" instead of "string"
pandas.HDFStore.append: Parameter "nan_rep     " type should use "str" instead of "string"
pandas.HDFStore.append: Parameter "encoding    " type should use "str" instead of "string"
pandas.HDFStore.append: Parameter "dropna      " type should use "bool" instead of "boolean"
pandas.read_spss: Parameter "path" type should use "str" instead of "string"
pandas.read_sql_query: Parameter "sql" type should use "str" instead of "string"
pandas.read_sql_query: Parameter "con" type should use "str" instead of "string"
pandas.read_sql_query: Parameter "index_col" type should use "str" instead of "string"
pandas.read_sql_query: Parameter "coerce_float" type should use "bool" instead of "boolean"
pandas.read_sql: Parameter "sql" type should use "str" instead of "string"
pandas.read_sql: Parameter "con" type should use "str" instead of "string"
pandas.read_sql: Parameter "index_col" type should use "str" instead of "string"
pandas.read_sql: Parameter "coerce_float" type should use "bool" instead of "boolean"
pandas.read_gbq: Parameter "reauth" type should use "bool" instead of "boolean"
pandas.read_gbq: Parameter "auth_local_webserver" type should use "bool" instead of "boolean"
pandas.read_stata: Parameter "convert_dates" type should use "bool" instead of "boolean"
pandas.read_stata: Parameter "convert_categoricals" type should use "bool" instead of "boolean"
pandas.read_stata: Parameter "encoding" type should use "str" instead of "string"
pandas.read_stata: Parameter "index_col" type should use "str" instead of "string"
pandas.read_stata: Parameter "convert_missing" type should use "bool" instead of "boolean"
pandas.read_stata: Parameter "preserve_dtypes" type should use "bool" instead of "boolean"
pandas.read_stata: Parameter "order_categoricals" type should use "bool" instead of "boolean"
pandas.read_stata: Parameter "iterator" type should use "bool" instead of "boolean"
pandas.io.stata.StataReader.data: Parameter "convert_dates" type should use "bool" instead of "boolean"
pandas.io.stata.StataReader.data: Parameter "convert_categoricals" type should use "bool" instead of "boolean"
pandas.io.stata.StataReader.data: Parameter "index_col" type should use "str" instead of "string"
pandas.io.stata.StataReader.data: Parameter "convert_missing" type should use "bool" instead of "boolean"
pandas.io.stata.StataReader.data: Parameter "preserve_dtypes" type should use "bool" instead of "boolean"
pandas.io.stata.StataReader.data: Parameter "order_categoricals" type should use "bool" instead of "boolean"
pandas.core.resample.Resampler.pipe: Parameter "func" type should use "str" instead of "string"
pandas.testing.assert_frame_equal: Parameter "check_index_type" type should use "str" instead of "string"
pandas.testing.assert_frame_equal: Parameter "check_column_type" type should use "str" instead of "string"
pandas.testing.assert_series_equal: Parameter "check_index_type" type should use "str" instead of "string"
pandas.testing.assert_index_equal: Parameter "exact" type should use "str" instead of "string"
pandas.api.types.union_categoricals: Parameter "sort_categories" type should use "bool" instead of "boolean"
pandas.api.types.union_categoricals: Parameter "ignore_order" type should use "bool" instead of "boolean"
pandas.api.types.is_list_like: Parameter "allow_sets" type should use "bool" instead of "boolean"
pandas.qcut: Parameter "q" type should use "int" instead of "integer"
pandas.qcut: Parameter "labels" type should use "bool" instead of "boolean"
pandas.merge_asof: Parameter "left_index" type should use "bool" instead of "boolean"
pandas.merge_asof: Parameter "right_index" type should use "bool" instead of "boolean"
pandas.merge_asof: Parameter "tolerance" type should use "int" instead of "integer"
pandas.merge_asof: Parameter "allow_exact_matches" type should use "bool" instead of "boolean"
pandas.to_numeric: Parameter "downcast" type should use "int" instead of "integer"
pandas.period_range: Parameter "start" type should use "str" instead of "string"
pandas.period_range: Parameter "end" type should use "str" instead of "string"
pandas.period_range: Parameter "periods" type should use "int" instead of "integer"
pandas.period_range: Parameter "freq" type should use "str" instead of "string"
pandas.period_range: Parameter "name" type should use "str" instead of "string"
pandas.timedelta_range: Parameter "start" type should use "str" instead of "string"
pandas.timedelta_range: Parameter "end" type should use "str" instead of "string"
pandas.timedelta_range: Parameter "periods" type should use "int" instead of "integer"
pandas.timedelta_range: Parameter "freq" type should use "str" instead of "string"
pandas.timedelta_range: Parameter "name" type should use "str" instead of "string"
pandas.timedelta_range: Parameter "closed" type should use "str" instead of "string"
pandas.infer_freq: Parameter "warn" type should use "bool" instead of "boolean"
pandas.interval_range: Parameter "periods" type should use "int" instead of "integer"
pandas.interval_range: Parameter "freq" type should use "str" instead of "string"
pandas.interval_range: Parameter "name" type should use "str" instead of "string"
pandas.eval: Parameter "parser" type should use "str" instead of "string"
pandas.eval: Parameter "engine" type should use "str" instead of "string"
pandas.util.hash_array: Parameter "encoding" type should use "str" instead of "string"
pandas.util.hash_array: Parameter "hash_key" type should use "str" instead of "string"
pandas.util.hash_pandas_object: Parameter "index" type should use "bool" instead of "boolean"
pandas.util.hash_pandas_object: Parameter "encoding" type should use "str" instead of "string"
pandas.util.hash_pandas_object: Parameter "hash_key" type should use "str" instead of "string"
pandas.Index.shift: Parameter "freq" type should use "str" instead of "string"
pandas.CategoricalIndex: Parameter "dtype" type should use "str" instead of "string"
pandas.IntervalIndex.from_arrays: Parameter "copy" type should use "bool" instead of "boolean"
pandas.IntervalIndex.from_tuples: Parameter "copy" type should use "bool" instead of "boolean"
pandas.IntervalIndex.from_breaks: Parameter "copy" type should use "bool" instead of "boolean"
pandas.IntervalIndex.to_tuples: Parameter "na_tuple" type should use "bool" instead of "boolean"
pandas.MultiIndex.to_frame: Parameter "index" type should use "bool" instead of "boolean"
pandas.MultiIndex.to_frame: Parameter "name" type should use "str" instead of "string"
pandas.MultiIndex.sortlevel: Parameter "ascending" type should use "bool" instead of "boolean"
pandas.DatetimeIndex.indexer_at_time: Parameter "time" type should use "str" instead of "string"
pandas.PeriodIndex: Parameter "data" type should use "int" instead of "integer"
pandas.PeriodIndex: Parameter "freq" type should use "str" instead of "string"
pandas.PeriodIndex.to_timestamp: Parameter "freq" type should use "str" instead of "string"
pandas.core.groupby.GroupBy.pipe: Parameter "func" type should use "str" instead of "string"
pandas.core.groupby.DataFrameGroupBy.idxmax: Parameter "skipna" type should use "bool" instead of "boolean"
pandas.core.groupby.DataFrameGroupBy.idxmin: Parameter "skipna" type should use "bool" instead of "boolean"
pandas.core.groupby.DataFrameGroupBy.nunique: Parameter "dropna" type should use "bool" instead of "boolean"
pandas.core.groupby.DataFrameGroupBy.shift: Parameter "freq" type should use "str" instead of "string"
pandas.io.formats.style.Styler.set_table_attributes: Parameter "attributes" type should use "str" instead of "string"
pandas.api.extensions.ExtensionArray._from_sequence: Parameter "copy" type should use "bool" instead of "boolean"
pandas.api.extensions.ExtensionArray._from_sequence_of_strings: Parameter "copy" type should use "bool" instead of "boolean"
pandas.api.extensions.ExtensionArray.take: Parameter "indices" type should use "int" instead of "integer"
pandas.DataFrame.idxmax: Parameter "skipna" type should use "bool" instead of "boolean"
pandas.DataFrame.idxmin: Parameter "skipna" type should use "bool" instead of "boolean"
pandas.DataFrame.unstack: Parameter "fill_value" type should use "str" instead of "string"
pandas.DataFrame.to_json: Parameter "indent" type should use "int" instead of "integer"
```

Hints from issue discussion:
I'm working on issues in `pandas.DataFrame`, `pandas.ExcelWriter`, `pandas.arrays.IntervalArray` and `pandas.timedelta_range`.  
Hey, I want to start contributing, can I take some from to leftover to get myself started?
 
I have worked on the issue `pandas.interval_range`,` pandas.util.hash_array` and `pandas.util.hash_pandas_object`. 
Can someone please review and help me to correct if I'm wrong!
Can we turn the list in the OP into checkboxes and update it so we can see what still needs to be done
Hey, Is this issue still open? I am a newbie to Open Source and want to contribute.
take

@LauraCollard I am unable to locate the folders in order to fix this issue, Can you please tell me how many of them are fixed and which ones require fixing. Maybe using checkboxes will be more efficient and easy to understand.
@MarcoGorelli  I have checked all the files and this issue has already been resolved. I think you should close this issue.
Thanks @Varun270 - if you add PR06 to

https://github.com/pandas-dev/pandas/blob/73c473dce9f07bba96993c42843320e116cf94ea/ci/code_checks.sh#L92-L93

then that'll close the issue
Okay sure

Commit message: Merge branch 'master' into Development

Patch to review:
diff --git a/ci/code_checks.sh b/ci/code_checks.sh
index 7e4b5775af317..68ad4d2efb37b 100755
--- a/ci/code_checks.sh
+++ b/ci/code_checks.sh
@@ -89,8 +89,8 @@ fi
 ### DOCSTRINGS ###
 if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
 
-    MSG='Validate docstrings (GL02, GL03, GL04, GL05, GL06, GL07, GL09, GL10, SS01, SS02, SS04, SS05, PR03, PR04, PR05, PR10, EX04, RT01, RT04, RT05, SA02, SA03)' ; echo $MSG
-    $BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=GL02,GL03,GL04,GL05,GL06,GL07,GL09,GL10,SS02,SS04,SS05,PR03,PR04,PR05,PR10,EX04,RT01,RT04,RT05,SA02,SA03
+    MSG='Validate docstrings (GL02, GL03, GL04, GL05, GL06, GL07, GL09, GL10, SS01, SS02, SS04, SS05, PR03, PR04, PR05, PR06, PR10, EX04, RT01, RT04, RT05, SA02, SA03)' ; echo $MSG
+    $BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=GL02,GL03,GL04,GL05,GL06,GL07,GL09,GL10,SS02,SS04,SS05,PR03,PR04,PR05,PR06,PR10,EX04,RT01,RT04,RT05,SA02,SA03
     RET=$(($RET + $?)) ; echo $MSG "DONE"
 
 fi


Code review comments:
diff_hunk: @@ -48,7 +48,7 @@ def to_numeric(arg, errors="raise", downcast=None):
         - If 'raise', then invalid parsing will raise an exception.
         - If 'coerce', then invalid parsing will be set as NaN.
         - If 'ignore', then invalid parsing will return the input.
-    downcast : {'integer', 'signed', 'unsigned', 'float'}, default None
+    downcast : {'int', 'signed', 'unsigned', 'float'}, default None
path: pandas/core/tools/numeric.py
text: @user1:
needs to be a fix similar to what you did in pandas/core/arrays/sparse/array.py, this won't work

@author:
Okay you mean something like this -
```
downcast : str
           Can be 'integer' or 'signed' or 'unsigned' or 'float', default is 'None'.
```


@user1:
I'd suggest
```
downcast : str, default None
    Can be 'integer', 'signed', 'unsigned', or 'float'.
```

diff_hunk: @@ -93,8 +93,8 @@ fi
 ### DOCSTRINGS ###
 if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
 
-    MSG='Validate docstrings (GL01, GL02, GL03, GL04, GL05, GL06, GL07, GL09, GL10, SS01, SS02, SS03, SS04, SS05, PR03, PR04, PR05, PR08, PRO9, PR10, EX04, RT01, RT04, RT05, SA02, SA03)' ; echo $MSG
-    $BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=GL01,GL02,GL03,GL04,GL05,GL06,GL07,GL09,GL10,SS02,SS03,SS04,SS05,PR03,PR04,PR05,PR08,PR09,PR10,EX04,RT01,RT04,RT05,SA02,SA03
+    MSG='Validate docstrings (GL02, GL03, GL04, GL05, GL06, GL07, GL09, GL10, SS01, SS02, SS04, SS05, PR03, PR04, PR05, PR06, PR10, EX04, RT01, RT04, RT05, SA02, SA03)' ; echo $MSG
+    $BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=GL02,GL03,GL04,GL05,GL06,GL07,GL09,GL10,SS02,SS04,SS05,PR03,PR04,PR05,PR06,PR10,EX04,RT01,RT04,RT05,SA02,SA03
path: ci/code_checks.sh
text: @user1:
I don't think you did the merge quite correctly - can you try again, and make sure that you only add PR06 (and not remove anything else, nor add any blank lines)?

@author:
Do you mean I have to add GL01, SS03, PR08, and PR09? Since PR06 is already added.

@user1:
the diff shows that your PR removes GL01, SS03, PR08, and PR09 - these should not be removed, the only thing this PR should do to this file is to add PR06