stub for sklearn.datasets.load_iris is missing a return type option
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- machine-learning
Research direction
Search the sklearn.datasets stubs for the load_iris entry point and compare its return annotation with the linked documentation. Update the annotation to represent the return_X_y alternatives, then run the repository’s stub or type-check validation if available; it is done when both documented return forms are represented.
Written by the indexing model from the issue text.
Description
The Returns section of the docstring for sklearn.datasets.load_iris() has two options:
- An
sklearn.utils.Bunch, ifreturn_X_yisFalse - A
tuple[ndarray, ndarray]ifreturn_X_yisTrue
The type stub for the function is
def load_iris(*, return_X_y: bool = False, as_frame: bool = False) -> tuple[Bunch, tuple]: ...
but I believe it should be:
def load_iris(*, return_X_y: bool = False, as_frame: bool = False) -> Bunch | tuple[ndarray, ndarray]: ...
or at least:
def load_iris(*, return_X_y: bool = False, as_frame: bool = False) -> Bunch | tuple: ...
which might be all we can get with parsing.
This might not be the only case of this in the codebase, but unfortunately I just have enough time to write this ticket. Normally I like to come with a bit more information, sorry about that.
- Dominant language
- Python
- Stars
- 304
- Forks
- 104
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/python-type-stubs
-
Maintenance Status Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
microsoft/python-type-stubs#395 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 58/100
microsoft/python-type-stubs#392 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
microsoft/python-type-stubs#315 · 1 comment ·
-
Unparameterized `np.ndarray` typings produce "Type of ... is partially unknown" Pyright type errors. Openbug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
microsoft/python-type-stubs#309 · 4 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
microsoft/python-type-stubs#211 · 8 comments · 29 reactions ·
All issues in microsoft/python-type-stubs
Similar issues
-
area/auth bug comp/agent P3 platform/discord type/security
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
NousResearch/hermes-agent#117848 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100