From a7335cb0b3c65174b5eb04b072fa48f28d1ff7cf Mon Sep 17 00:00:00 2001 From: caneff Date: Wed, 20 Sep 2023 11:26:38 -0400 Subject: [PATCH] Remove deprecated week and weekofyear for Pandas 2 (#28492) --- sdks/python/apache_beam/dataframe/frames.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sdks/python/apache_beam/dataframe/frames.py b/sdks/python/apache_beam/dataframe/frames.py index 7929c879bdd2..80af501cfacb 100644 --- a/sdks/python/apache_beam/dataframe/frames.py +++ b/sdks/python/apache_beam/dataframe/frames.py @@ -5377,11 +5377,12 @@ def func(df, *args, **kwargs): 'second', 'time', 'timetz', - 'week', 'weekday', - 'weekofyear', 'year', ] +# Pandas 2 removed these. +if PD_VERSION < (2, 0): + ELEMENTWISE_DATETIME_PROPERTIES += ['week', 'weekofyear'] for method in ELEMENTWISE_DATETIME_PROPERTIES: setattr(_DeferredDatetimeMethods,