dataframe-api icon indicating copy to clipboard operation
dataframe-api copied to clipboard

Document the mutability assumptions for the interop protocol

Open rgommers opened this issue 4 years ago • 0 comments

This was just asked about at https://twitter.com/AlexMonahan/status/1430522318854377475. I'd say we should have a similar argument as https://data-apis.org/array-api/latest/design_topics/copies_views_and_mutation.html. We cannot prevent mutations in the protocol itself, and existing libraries already may have APIs that do mutate in-place. So we should recommend against it (but of course power users that really understand what they are doing could go right ahead and mutate to their hearts' content - this is the same as for the buffer protocol, DLPack et al.).

There's an earlier discussion at https://github.com/data-apis/dataframe-api/issues/10 (which was unrelated to the protocol). The general sentiment was that in-place operations must be avoided for a full dataframe API.

Right now https://data-apis.org/dataframe-protocol/latest/ says nothing about mutability, this should be added.

rgommers avatar Aug 25 '21 15:08 rgommers