Skip to content

Commit 2aa4448

Browse files
committed
note that insertion order is not guaranteed and may vary
1 parent dd6a68c commit 2aa4448

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

spec/API_specification/dataframe_api/dataframe_object.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,22 +203,23 @@ def insert_columns(self, columns: Column[Any] | Sequence[Column[Any]]) -> DataFr
203203
df = df.insert_column(new_column.rename('a_plus_1'))
204204
df = df.get_columns_by_name(new_column_names)
205205
206-
If inserting multiple columns, they must be indepedent.
207-
For example,
206+
If inserting multiple columns, then the order in which they are inserted
207+
is not guaranteed and may vary across implementations. For example, the
208+
following
208209
209210
.. code-block:: python
210211
211212
new_column_1 = df.get_column_by_name('a').rename('b')
212213
new_column_2 = (new_column_1 + 2).rename('c')
213214
df.insert_columns([new_column_1, new_column_2])
214215
215-
is not allowed, as `new_column_2` depends on `new_column_1`.
216+
is not supported, as `new_column_2` is derived from `new_column_1`, which may
217+
not be part of the dataframe if `new_column_2` is inserted first.
216218
217219
Parameters
218220
----------
219221
columns : Column | Sequence[Column]
220-
Column(s) to insert. Must be independent of each other, so that insertion
221-
can happen in parallel in some implementations.
222+
Column(s) to insert. Insertion order is not guaranteed.
222223
"""
223224
...
224225

0 commit comments

Comments
 (0)