pydata / pydata/xarray

Update assign to preserve order for **kwargs

Open
#1,901 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
4.2k
Forks
1.4k
Avg merge
2d 15h
Merged PRs (30d)
14

Description

In Python 3.6+, keyword arguments preserve the order in which they are written. We should update assign and assign_coords to rely on this in the next major release, as has been done in pandas:
https://github.com/pandas-dev/pandas/issues/14207

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the assign and assign_coords entry points and review the linked pandas issue for the intended keyword-order behavior. Done means both functions preserve the order of keyword arguments on Python 3.6 and newer, while accounting for the planned next-major-release change.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.