Skip to content

Commit a0ca4db

Browse files
committed
Merge branch 'newfeature' of https://github.com/lfffkh/pandas into newfeature
2 parents 0b7d2a0 + e3a3a4a commit a0ca4db

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ minimum_pre_commit_version: 2.15.0
22
exclude: ^LICENSES/|\.(html|csv|svg)$
33
# reserve "manual" for relatively slow hooks which we still want to run in CI
44
default_stages: [
5-
commit,
6-
merge-commit,
7-
push,
5+
pre-commit,
6+
pre-merge-commit,
7+
pre-push,
88
prepare-commit-msg,
99
commit-msg,
1010
post-checkout,

ci/code_checks.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
140140
-i "pandas.errors.OutOfBoundsTimedelta SA01" \
141141
-i "pandas.errors.PerformanceWarning SA01" \
142142
-i "pandas.errors.PossibleDataLossError SA01" \
143-
-i "pandas.errors.PossiblePrecisionLoss SA01" \
144143
-i "pandas.errors.UndefinedVariableError PR01,SA01" \
145144
-i "pandas.errors.UnsortedIndexError SA01" \
146145
-i "pandas.errors.UnsupportedFunctionCall SA01" \

pandas/core/strings/accessor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,9 @@ def _validate(data):
255255
inferred_dtype = lib.infer_dtype(values, skipna=True)
256256

257257
if inferred_dtype not in allowed_types:
258-
raise AttributeError("Can only use .str accessor with string values!")
258+
raise AttributeError(
259+
f"Can only use .str accessor with string values, not {inferred_dtype}"
260+
)
259261
return inferred_dtype
260262

261263
def __getitem__(self, key):

pandas/errors/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,10 @@ class PossiblePrecisionLoss(Warning):
691691
When the column value is outside or equal to the int64 value the column is
692692
converted to a float64 dtype.
693693
694+
See Also
695+
--------
696+
DataFrame.to_stata : Export DataFrame object to Stata dta format.
697+
694698
Examples
695699
--------
696700
>>> df = pd.DataFrame({"s": pd.Series([1, 2**53], dtype=np.int64)})

pandas/tests/series/accessors/test_str_accessor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ def test_str_attribute(self):
1515

1616
# str accessor only valid with string values
1717
ser = Series(range(5))
18-
with pytest.raises(AttributeError, match="only use .str accessor"):
18+
msg = "Can only use .str accessor with string values, not integer"
19+
with pytest.raises(AttributeError, match=msg):
1920
ser.str.repeat(2)
2021

2122
def test_str_accessor_updates_on_inplace(self):

0 commit comments

Comments
 (0)