Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion bigframes/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -3705,7 +3705,9 @@ def to_numpy(
) -> numpy.ndarray:
return self.to_pandas().to_numpy(dtype, copy, na_value, **kwargs)

def __array__(self, dtype=None) -> numpy.ndarray:
def __array__(self, dtype=None, copy: Optional[bool] = None) -> numpy.ndarray:
if copy is False:
raise ValueError("Cannot convert to array without copy.")
return self.to_numpy(dtype=dtype)

__array__.__doc__ = inspect.getdoc(vendored_pandas_frame.DataFrame.__array__)
Expand Down
4 changes: 3 additions & 1 deletion bigframes/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1812,7 +1812,9 @@ def to_numpy(
) -> numpy.ndarray:
return self.to_pandas().to_numpy(dtype, copy, na_value, **kwargs)

def __array__(self, dtype=None) -> numpy.ndarray:
def __array__(self, dtype=None, copy: Optional[bool] = None) -> numpy.ndarray:
if copy is False:
raise ValueError("Cannot convert to array without copy.")
return self.to_numpy(dtype=dtype)

__array__.__doc__ = inspect.getdoc(vendored_pandas_series.Series.__array__)
Expand Down
4 changes: 3 additions & 1 deletion third_party/bigframes_vendored/pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -7179,7 +7179,7 @@ def __len__(self):
"""
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

def __array__(self):
def __array__(self, dtype=None, copy: Optional[bool] = None):
"""
Returns the rows as NumPy array.

Expand Down Expand Up @@ -7210,6 +7210,8 @@ def __array__(self):
dtype (str or numpy.dtype, optional):
The dtype to use for the resulting NumPy array. By default,
the dtype is inferred from the data.
copy (bool or None, optional):
Whether to copy the data, False is not supported.

Returns:
numpy.ndarray:
Expand Down
4 changes: 3 additions & 1 deletion third_party/bigframes_vendored/pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -5941,7 +5941,7 @@ def size(self) -> int:
"""
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

def __array__(self, dtype=None) -> numpy.ndarray:
def __array__(self, dtype=None, copy: Optional[bool] = None) -> numpy.ndarray:
"""
Returns the values as NumPy array.

Expand All @@ -5965,6 +5965,8 @@ def __array__(self, dtype=None) -> numpy.ndarray:
dtype (str or numpy.dtype, optional):
The dtype to use for the resulting NumPy array. By default,
the dtype is inferred from the data.
copy (bool or None, optional):
Whether to copy the data, False is not supported.

Returns:
numpy.ndarray:
Expand Down