NVIDIA / NVIDIA/cudf

[FEA] Avoid passing a fully initialized `MultiIndex` into `MultiIndex.__init__`

Open
#18,900 0 comments 0 reactions 0 assignees View on GitHub
feature request Python
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

After the removal of `BaseIndex`, https://github.com/rapidsai/cudf/pull/18751/, `Index` and it's subclasses mirror `pandas.Index` and its subclasses; moreover, we've had to implement construction in `__new__` instead of `__init__`.

There is a lingering wart in the implementation where an invocation like `cudf.Index(pd.MultiIndex(...))` passes a fully initialized `cudf.MultiIndex` (`self`) into `MultIndex.__init__`, mentioned in https://github.com/rapidsai/cudf/pull/18751/files#r2098689962.

Currently we just `return` in this case, but ideally we should not need this workaround.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.