Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion xarray/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -7066,7 +7066,7 @@ def to_pandas(self) -> pd.Series | pd.DataFrame:
"Please use Dataset.to_dataframe() instead."
)

def _to_dataframe(self, ordered_dims: Mapping[Any, int]):
def _to_dataframe(self, ordered_dims: Mapping[Any, int], copy: bool = True):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like it needs to be added to the to_dataframe method

from xarray.core.extension_array import PandasExtensionArray

columns_in_order = [k for k in self.variables if k not in self.dims]
Expand Down Expand Up @@ -7104,6 +7104,7 @@ def _to_dataframe(self, ordered_dims: Mapping[Any, int]):
},
},
index=index,
copy=copy,
)
for extension_array_column in extension_array_columns_different_index:
extension_array = self.variables[extension_array_column].data
Expand Down
Loading