Skip to content

Document deep parameter in ExtensionArray.copy #22314

Closed
@TomAugspurger

Description

@TomAugspurger

And pass it through via Series.copy.

diff --git a/pandas/tests/extension/decimal/array.py b/pandas/tests/extension/decimal/array.py
index 108b8874b..7085a231b 100644
--- a/pandas/tests/extension/decimal/array.py
+++ b/pandas/tests/extension/decimal/array.py
@@ -78,6 +78,7 @@ class DecimalArray(ExtensionArray, ExtensionScalarOpsMixin):
         return self._from_sequence(result)
 
     def copy(self, deep=False):
+        print(deep)
         if deep:
             return type(self)(self._data.copy())
         return type(self)(self)
In [1]: import pandas as pd; import numpy as np;

In [2]: from pandas.tests.extension.decimal.array import *

In [3]: s = pd.Series(DecimalArray([decimal.Decimal(1)]))

In [4]: s.copy(deep=False)
Out[4]:
0    1
dtype: decimal

In [5]: s.copy(deep=True)
False
Out[5]:
0    1
dtype: decimal

Metadata

Metadata

Assignees

No one assigned

    Labels

    ExtensionArrayExtending pandas with custom dtypes or arrays.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions