Skip to content

enh: add maintain_order to Expr.unique and Series.unique #1328

Closed
@MarcoGorelli

Description

@MarcoGorelli

As requested here plotly/plotly.py#4790 (comment)

We already have maintain_order for DataFrame.unique, my concern is that for some libraries this may turn out to not be guaranteed (and for there to not be any option to guarantee it)

However, a workaround like

token = f'{s.name}_tmp'
s.to_frame().with_row_index(token).unique(col).sort(token).get_column(col)

should always be possible, were some library to stop guaranteeing it

It's not clear to me whether PyArrow makes any guarantees - we can always just use it for now, and if it stop making such guarantees, we use the workaround above apache/arrow#44663

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthigh priorityYour PR will be reviewed very quickly if you address this

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions