Skip to content

Get ready for pandas 3 copy-on-write #8843

@dcherian

Description

@dcherian

What is your issue?

This line fails with pd.set_options("mode.copy_on_write", True)

assert all(obj.data.flags.writeable for obj in obj.variables.values())

We'll need to fix this before Pandas 3 is released in April:

assert all(obj.data.flags.writeable for obj in obj.variables.values())

Here's a test

def example():
    obj = Dataset()
    obj["dim2"] = ("dim2", 0.5 * np.arange(9))
    obj["time"] = ("time", pd.date_range("2000-01-01", periods=20)
    print({k: v.data.flags for k, v in obj.variables.items()})
    return obj

example()
pd.set_options("mode.copy_on_write", True)
example()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions