Skip to content

Commit 010ffe2

Browse files
test_datetimes.py: fix literal string (#60820)
* test_datetimes.py: fix literal string * fix test * fix repeated whitespace * add whatsnew entry * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 7283953 commit 010ffe2

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

doc/source/whatsnew/v3.0.0.rst

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Other enhancements
7575
- Added half-year offset classes :class:`HalfYearBegin`, :class:`HalfYearEnd`, :class:`BHalfYearBegin` and :class:`BHalfYearEnd` (:issue:`60928`)
7676
- Errors occurring during SQL I/O will now throw a generic :class:`.DatabaseError` instead of the raw Exception type from the underlying driver manager library (:issue:`60748`)
7777
- Implemented :meth:`Series.str.isascii` and :meth:`Series.str.isascii` (:issue:`59091`)
78+
- Improved deprecation message for offset aliases (:issue:`60820`)
7879
- Multiplying two :class:`DateOffset` objects will now raise a ``TypeError`` instead of a ``RecursionError`` (:issue:`59442`)
7980
- Restore support for reading Stata 104-format and enable reading 103-format dta files (:issue:`58554`)
8081
- Support passing a :class:`Iterable[Hashable]` input to :meth:`DataFrame.drop_duplicates` (:issue:`59237`)

pandas/_libs/tslibs/offsets.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5108,7 +5108,7 @@ def _warn_about_deprecated_aliases(name: str, is_period: bool) -> str:
51085108
warnings.warn(
51095109
f"\'{name}\' is deprecated and will be removed "
51105110
f"in a future version, please use "
5111-
f"\'{c_PERIOD_AND_OFFSET_DEPR_FREQSTR.get(name)}\' "
5111+
f"\'{c_PERIOD_AND_OFFSET_DEPR_FREQSTR.get(name)}\'"
51125112
f" instead.",
51135113
FutureWarning,
51145114
stacklevel=find_stack_level(),
@@ -5122,7 +5122,7 @@ def _warn_about_deprecated_aliases(name: str, is_period: bool) -> str:
51225122
warnings.warn(
51235123
f"\'{name}\' is deprecated and will be removed "
51245124
f"in a future version, please use "
5125-
f"\'{_name}\' "
5125+
f"\'{_name}\'"
51265126
f" instead.",
51275127
FutureWarning,
51285128
stacklevel=find_stack_level(),

pandas/tests/arrays/test_datetimes.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,10 @@ def test_date_range_frequency_M_Q_Y_raises(self, freq):
769769
@pytest.mark.parametrize("freq_depr", ["2MIN", "2nS", "2Us"])
770770
def test_date_range_uppercase_frequency_deprecated(self, freq_depr):
771771
# GH#9586, GH#54939
772-
depr_msg = f"'{freq_depr[1:]}' is deprecated and will be removed in a "
773-
f"future version. Please use '{freq_depr.lower()[1:]}' instead."
772+
depr_msg = (
773+
f"'{freq_depr[1:]}' is deprecated and will be removed in a "
774+
f"future version, please use '{freq_depr.lower()[1:]}' instead."
775+
)
774776

775777
expected = pd.date_range("1/1/2000", periods=4, freq=freq_depr.lower())
776778
with tm.assert_produces_warning(FutureWarning, match=depr_msg):

0 commit comments

Comments
 (0)