We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 66951dc commit 4c201b0Copy full SHA for 4c201b0
pandas/core/groupby/generic.py
@@ -1182,9 +1182,17 @@ def first_not_none(values):
1182
if v is None:
1183
return DataFrame()
1184
elif isinstance(v, NDFrame):
1185
+
1186
+ # this is to silence a FutureWarning
1187
+ # TODO: Remove when default dtype of empty Series is object
1188
+ kwargs = v._construct_axes_dict()
1189
+ if v._constructor is Series:
1190
+ is_empty = "data" not in kwargs or not kwargs["data"]
1191
+ if "dtype" not in kwargs and is_empty:
1192
+ kwargs["dtype"] = object
1193
1194
values = [
- x if x is not None else v._constructor(**v._construct_axes_dict())
- for x in values
1195
+ x if (x is not None) else v._constructor(**kwargs) for x in values
1196
]
1197
1198
v = values[0]
0 commit comments