luth2 commented on code in PR #45823:
URL: https://github.com/apache/superset/pull/45823#discussion_r4431524559
##########
superset/utils/pandas_postprocessing/resample.py:
##########
@@ -240,10 +240,19 @@ def resample( # pylint: disable=too-many-arguments
_validate_projected_rows(df.index.min(), df.index.max(), rule)
if method == "asfreq" and fill_value is not None:
+ string_columns = [
+ column
+ for column in df.columns
+ if isinstance(df[column].dtype, pd.StringDtype)
+ ]
+ if len(string_columns):
+ df = df.astype(dict.fromkeys(string_columns, object))
_df = df.resample(rule).asfreq(fill_value=fill_value)
_df = _df.fillna(fill_value)
elif method == "linear":
- _df = df.resample(rule).interpolate()
+ _df = df.resample(rule).asfreq()
Review Comment:
Validated as fixed; audit commit e8e1b5cf85. Linear resampling includes
datetime and timezone-aware datetime columns alongside numeric columns. The
regression checks the missing middle datetime for naive and timezone-aware
values; the complete resample module passed on Python 3.11/pandas 3.0.6 and
Python 3.15/pandas 3.1.0.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]