Skip to content

Conversation

@thomass-dev
Copy link
Collaborator

@thomass-dev thomass-dev commented Oct 17, 2025

Ensure that the pre-commit mypy hook in our monorepo context is strictly equivalent to running mypy manually.

Note that additional_dependencies must be now synchronized with pyproject.toml. Otherwise, the hook fails in a good way:

error: Cannot find implementation or library stub for module named "<module>  [import-not-found]

You will be able to run the hooks using:

$ pre-commit run --all-files mypy                                                                                                                                                                                                         

mypy skore/..............................................................Passed
mypy skore-hub-project/..................................................Passed
mypy skore-local-project/................................................Passed

$ pre-commit run --all-files mypy-skore

mypy skore/..............................................................Passed

$ pre-commit run --all-files mypy-skore-hub-project

mypy skore-hub-project/..................................................Passed

$ pre-commit run --all-files mypy-skore-local-project

mypy skore-local-project/................................................Passed

@thomass-dev thomass-dev changed the title fix(ci): Fix pre-commit mypy hook in our mono-repo context fix(ci): Fix pre-commit mypy hook in mono-repo context Oct 17, 2025
@thomass-dev thomass-dev changed the title fix(ci): Fix pre-commit mypy hook in mono-repo context fix(ci): Fix pre-commit mypy Oct 17, 2025
@thomass-dev thomass-dev force-pushed the fix-pre-commit-mypy branch 6 times, most recently from ac6b333 to dfd3fb0 Compare October 21, 2025 11:42
@thomass-dev
Copy link
Collaborator Author

thomass-dev commented Oct 21, 2025

$ python -m mypy --config-file=skore-local-project/pyproject.toml skore-local-project/                                                                            
                                                                        
skore-local-project/src/skore_local_project/metadata.py:17: error: Module "skore" has no attribute "CrossValidationReport"  [attr-defined]
skore-local-project/src/skore_local_project/metadata.py:17: error: Module "skore" has no attribute "EstimatorReport"  [attr-defined]
skore-local-project/src/skore_local_project/metadata.py:31: error: Module "skore" has no attribute "CrossValidationReport"  [attr-defined]
skore-local-project/src/skore_local_project/metadata.py:31: error: Module "skore" has no attribute "EstimatorReport"  [attr-defined]
skore-local-project/src/skore_local_project/project.py:22: error: Module "skore" has no attribute "CrossValidationReport"  [attr-defined]
skore-local-project/src/skore_local_project/project.py:22: error: Module "skore" has no attribute "EstimatorReport"  [attr-defined]
skore-local-project/src/skore_local_project/project.py:206: error: Module "skore" has no attribute "CrossValidationReport"  [attr-defined]
skore-local-project/src/skore_local_project/project.py:206: error: Module "skore" has no attribute "EstimatorReport"  [attr-defined]
Found 8 errors in 2 files (checked 4 source files) 
$ python -m mypy --config-file=skore-hub-project/pyproject.toml skore-hub-project/                                                                                                                                                        

skore-hub-project/src/skore_hub_project/client/api.py:129: error: "HTTPError" has no attribute "response"  [attr-defined]
skore-hub-project/src/skore_hub_project/client/client.py:61: error: Incompatible types in assignment (expression has type "tuple[type[TimeoutException], type[NetworkError], type[RemoteProtocolError]]", variable has type "tuple[HTTPError, ...]")  [assignment]
skore-hub-project/src/skore_hub_project/client/client.py:96: error: Exception type must be derived from BaseException (or be a tuple of exception classes)  [misc]
skore-hub-project/src/skore_hub_project/report/report.py:86: error: Unexpected keyword argument "report" for "Metric"  [call-arg]
skore-hub-project/src/skore_hub_project/report/report.py:108: error: Missing named argument "content_type" for "Media"  [call-arg]
skore-hub-project/src/skore_hub_project/report/report.py:108: error: Missing named argument "name" for "Media"  [call-arg]
Found 6 errors in 3 files (checked 38 source files)

Before #2076 and #2077 that fix the typings, and without this PR (commit 3aa7942):

$ pre-commit run --all-files mypy                                                                                                                                                                                                         

mypy.....................................................................Passed

Before #2076 and #2077 that fix the typings, and with this PR :

$ pre-commit run --all-files mypy                                                                                                                                                                                                         

mypy skore/..............................................................Passed
mypy skore-hub-project/..................................................Failed
- hook id: mypy
- exit code: 1

skore-hub-project/src/skore_hub_project/client/api.py:129: error: "HTTPError" has no attribute "response"  [attr-defined]
skore-hub-project/src/skore_hub_project/client/client.py:61: error: Incompatible types in assignment (expression has type "tuple[type[TimeoutException], type[NetworkError], type[RemoteProtocolError]]", variable has type "tuple[HTTPError, ...]")  [assignment]
skore-hub-project/src/skore_hub_project/client/client.py:96: error: Exception type must be derived from BaseException (or be a tuple of exception classes)  [misc]
skore-hub-project/src/skore_hub_project/report/report.py:86: error: Unexpected keyword argument "report" for "Metric"  [call-arg]
skore-hub-project/src/skore_hub_project/report/report.py:108: error: Missing named argument "content_type" for "Media"  [call-arg]
skore-hub-project/src/skore_hub_project/report/report.py:108: error: Missing named argument "name" for "Media"  [call-arg]
Found 6 errors in 3 files (checked 38 source files)

mypy skore-local-project/................................................Failed
- hook id: mypy
- exit code: 1

skore-local-project/src/skore_local_project/metadata.py:17: error: Module "skore" has no attribute "CrossValidationReport"  [attr-defined]
skore-local-project/src/skore_local_project/metadata.py:17: error: Module "skore" has no attribute "EstimatorReport"  [attr-defined]
skore-local-project/src/skore_local_project/metadata.py:31: error: Module "skore" has no attribute "CrossValidationReport"  [attr-defined]
skore-local-project/src/skore_local_project/metadata.py:31: error: Module "skore" has no attribute "EstimatorReport"  [attr-defined]
skore-local-project/src/skore_local_project/project.py:22: error: Module "skore" has no attribute "CrossValidationReport"  [attr-defined]
skore-local-project/src/skore_local_project/project.py:22: error: Module "skore" has no attribute "EstimatorReport"  [attr-defined]
skore-local-project/src/skore_local_project/project.py:206: error: Module "skore" has no attribute "CrossValidationReport"  [attr-defined]
skore-local-project/src/skore_local_project/project.py:206: error: Module "skore" has no attribute "EstimatorReport"  [attr-defined]
Found 8 errors in 2 files (checked 4 source files)

it shows that this PR works and fix our mypy hook!

@probabl-ai probabl-ai deleted a comment from github-actions bot Oct 21, 2025
@probabl-ai probabl-ai deleted a comment from github-actions bot Oct 21, 2025
@probabl-ai probabl-ai deleted a comment from github-actions bot Oct 21, 2025
@probabl-ai probabl-ai deleted a comment from github-actions bot Oct 21, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 21, 2025

Documentation preview @ 267c4bd

@github-actions
Copy link
Contributor

Coverage

Coverage Report for skore/
FileStmtsMissCoverMissing
skore/src/skore
   __init__.py230100% 
   _config.py310100% 
   exceptions.py440%4, 15, 19, 23
skore/src/skore/_sklearn
   __init__.py60100% 
   _base.py1981492%45, 58, 127, 130, 183, 186–187, 189–192, 225, 228–229
   find_ml_task.py610100% 
   types.py27196%28
skore/src/skore/_sklearn/_comparison
   __init__.py70100% 
   feature_importance_accessor.py39294%90, 109
   metrics_accessor.py178398%173, 253, 1215
   report.py1070100% 
   utils.py540100% 
skore/src/skore/_sklearn/_cross_validation
   __init__.py90100% 
   data_accessor.py45393%134, 137, 140
   feature_importance_accessor.py240100% 
   metrics_accessor.py182199%244
   report.py135199%487
skore/src/skore/_sklearn/_estimator
   __init__.py90100% 
   data_accessor.py66198%82
   feature_importance_accessor.py144298%223–224
   metrics_accessor.py356897%200, 202, 209, 300, 369, 373, 388, 423
   report.py167298%448–449
skore/src/skore/_sklearn/_plot
   __init__.py30100% 
   base.py102793%61–62, 200, 224–226, 230
   utils.py770100% 
skore/src/skore/_sklearn/_plot/data
   __init__.py20100% 
   table_report.py185199%706
skore/src/skore/_sklearn/_plot/metrics
   __init__.py60100% 
   confusion_matrix.py70494%92, 100, 122, 230
   feature_importance_display.py672168%88, 121–122, 124, 142–146, 148–155, 158–160, 162
   metrics_summary_display.py80100% 
   precision_recall_curve.py280598%455, 555, 559, 619, 751
   prediction_error.py227597%179, 186, 422, 505, 705
   roc_curve.py292897%385, 508, 513, 614, 619, 623, 692, 832
skore/src/skore/_sklearn/train_test_split
   __init__.py00100% 
   train_test_split.py580100% 
skore/src/skore/_sklearn/train_test_split/warning
   __init__.py80100% 
   high_class_imbalance_too_few_examples_warning.py19194%83
   high_class_imbalance_warning.py200100% 
   random_state_unset_warning.py100100% 
   shuffle_true_warning.py90100% 
   stratify_is_set_warning.py100100% 
   time_based_column_warning.py210100% 
   train_test_split_warning.py30100% 
skore/src/skore/_utils
   __init__.py6266%8, 13
   _accessor.py90396%34, 146, 190
   _environment.py270100% 
   _fixes.py80100% 
   _index.py50100% 
   _logger.py22481%15–17, 19
   _measure_time.py100100% 
   _parallel.py38392%23, 33, 124
   _patch.py13561%21, 23–24, 35, 37
   _progress_bar.py460100% 
   _repr_html.py80100% 
   _show_versions.py380100% 
   _testing.py550100% 
skore/src/skore/project
   __init__.py20100% 
   project.py480100% 
   summary.py75198%120
   widget.py1890100% 
TOTAL402911297% 

Tests Skipped Failures Errors Time
1077 5 💤 0 ❌ 0 🔥 4m 26s ⏱️

github-merge-queue bot pushed a commit that referenced this pull request Oct 21, 2025
Prerequisite for #2069.

```bash
python -m mypy --config-file=skore-hub-project/pyproject.toml skore-hub-project/                                                                                                                                                        

skore-hub-project/src/skore_hub_project/client/api.py:129: error: "HTTPError" has no attribute "response"  [attr-defined]
skore-hub-project/src/skore_hub_project/client/client.py:61: error: Incompatible types in assignment (expression has type "tuple[type[TimeoutException], type[NetworkError], type[RemoteProtocolError]]", variable has type "tuple[HTTPError, ...]")  [assignment]
skore-hub-project/src/skore_hub_project/client/client.py:96: error: Exception type must be derived from BaseException (or be a tuple of exception classes)  [misc]
skore-hub-project/src/skore_hub_project/report/report.py:86: error: Unexpected keyword argument "report" for "Metric"  [call-arg]
skore-hub-project/src/skore_hub_project/report/report.py:108: error: Missing named argument "content_type" for "Media"  [call-arg]
skore-hub-project/src/skore_hub_project/report/report.py:108: error: Missing named argument "name" for "Media"  [call-arg]
```

---

Note that i:
- changed the way a subclass of `ReportPayload` / `Media`/`Metric` can
restrict the type of `report`: it worked at runtime but broke the static
typing (in particular the Liskov Substitution Principle - LSP),
- set abstract pydantic property in abstractclass as
`Field(init=False)`.
github-merge-queue bot pushed a commit that referenced this pull request Oct 21, 2025
Prerequisite for #2069.

```bash
python -m mypy --config-file=skore-local-project/pyproject.toml skore-local-project/                                                                                                                                                    

skore-local-project/src/skore_local_project/metadata.py:17: error: Module "skore" has no attribute "CrossValidationReport"  [attr-defined]
skore-local-project/src/skore_local_project/metadata.py:17: error: Module "skore" has no attribute "EstimatorReport"  [attr-defined]
skore-local-project/src/skore_local_project/metadata.py:31: error: Module "skore" has no attribute "CrossValidationReport"  [attr-defined]
skore-local-project/src/skore_local_project/metadata.py:31: error: Module "skore" has no attribute "EstimatorReport"  [attr-defined]
skore-local-project/src/skore_local_project/project.py:22: error: Module "skore" has no attribute "CrossValidationReport"  [attr-defined]
skore-local-project/src/skore_local_project/project.py:22: error: Module "skore" has no attribute "EstimatorReport"  [attr-defined]
skore-local-project/src/skore_local_project/project.py:206: error: Module "skore" has no attribute "CrossValidationReport"  [attr-defined]
skore-local-project/src/skore_local_project/project.py:206: error: Module "skore" has no attribute "EstimatorReport"  [attr-defined]
```
@auguste-probabl
Copy link
Contributor

Pretty annoying that it doesn't do the right thing out of the box!

github-merge-queue bot pushed a commit that referenced this pull request Oct 28, 2025
Prerequisite for #2069.

```bash
$ python -m mypy --config-file=skore/pyproject.toml skore/                                                                                                                                                                                

skore/src/skore/project/widget.py:469: error: Argument 1 to "_update_dataset_dropdown" of "ModelExplorerWidget" has incompatible type "ndarray[tuple[Any, ...], dtype[Any]]"; expected "list[str]"  [arg-type]
skore/src/skore/project/widget.py:489: error: Argument 1 to "_update_dataset_dropdown" of "ModelExplorerWidget" has incompatible type "ndarray[tuple[Any, ...], dtype[Any]]"; expected "list[str]"  [arg-type]
skore/src/skore/_sklearn/train_test_split/train_test_split.py:216: error: Incompatible types in assignment (expression has type "None", variable has type "ndarray[tuple[Any, ...], dtype[Any]]")  [assignment]
skore/src/skore/_sklearn/_plot/metrics/roc_curve.py:262: error: Incompatible types in assignment (expression has type "None", variable has type "Line2D")  [assignment]
skore/src/skore/_sklearn/_plot/metrics/roc_curve.py:385: error: Incompatible types in assignment (expression has type "None", variable has type "Line2D")  [assignment]
skore/src/skore/_sklearn/_plot/metrics/roc_curve.py:508: error: Incompatible types in assignment (expression has type "None", variable has type "Line2D")  [assignment]
skore/src/skore/_sklearn/_plot/metrics/roc_curve.py:614: error: Incompatible types in assignment (expression has type "None", variable has type "Line2D")  [assignment]
skore/src/skore/_sklearn/_plot/metrics/roc_curve.py:677: error: Incompatible types in assignment (expression has type "list[Never]", variable has type "Line2D")  [assignment]
skore/src/skore/_sklearn/_plot/metrics/roc_curve.py:679: error: "Line2D" has no attribute "append"  [attr-defined]
skore/src/skore/_sklearn/_plot/metrics/roc_curve.py:687: error: Incompatible types in assignment (expression has type "None", variable has type "Line2D")  [assignment]
skore/src/skore/_sklearn/_plot/metrics/roc_curve.py:953: error: Value of type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]" is not indexable  [index]
skore/src/skore/_sklearn/_plot/metrics/roc_curve.py:953: error: No overload variant of "__getitem__" of "bytes" matches argument type "tuple[slice[None, None, None], int]"  [call-overload]
skore/src/skore/_sklearn/_plot/metrics/roc_curve.py:953: note: Possible overload variants:
skore/src/skore/_sklearn/_plot/metrics/roc_curve.py:953: note:     def __getitem__(self, SupportsIndex, /) -> int
skore/src/skore/_sklearn/_plot/metrics/roc_curve.py:953: note:     def __getitem__(self, slice[Any, Any, Any], /) -> bytes
skore/src/skore/_sklearn/_plot/metrics/roc_curve.py:953: error: Invalid index type "tuple[slice[None, None, None], int]" for "_NestedSequence[_SupportsArray[dtype[Any]]]"; expected type "int"  [index]
skore/src/skore/_sklearn/_plot/metrics/roc_curve.py:953: error: Invalid index type "tuple[slice[None, None, None], int]" for "str"; expected type "SupportsIndex | slice[Any, Any, Any]"  [index]
skore/src/skore/_sklearn/_plot/metrics/roc_curve.py:953: error: Invalid index type "tuple[slice[None, None, None], int]" for "_NestedSequence[complex | bytes | str]"; expected type "int"  [index]
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:268: error: Incompatible return value type (got "list[PathCollection]", expected "list[Artist]")  [return-value]
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:268: note: "list" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:268: note: Consider using "Sequence" instead, which is covariant
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:268: note: Perhaps you need a type annotation for "scatter"? Suggestion: "list[Artist]"
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:355: error: Incompatible return value type (got "list[PathCollection]", expected "list[Artist]")  [return-value]
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:355: note: "list" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:355: note: Consider using "Sequence" instead, which is covariant
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:355: note: Perhaps you need a type annotation for "scatter"? Suggestion: "list[Artist]"
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:438: error: Incompatible return value type (got "list[PathCollection]", expected "list[Artist]")  [return-value]
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:438: note: "list" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:438: note: Consider using "Sequence" instead, which is covariant
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:438: note: Perhaps you need a type annotation for "scatter"? Suggestion: "list[Artist]"
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:521: error: Incompatible return value type (got "list[PathCollection]", expected "list[Artist]")  [return-value]
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:521: note: "list" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:521: note: Consider using "Sequence" instead, which is covariant
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:521: note: Perhaps you need a type annotation for "scatter"? Suggestion: "list[Artist]"
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:829: error: Unsupported left operand type for - ("Buffer")  [operator]
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:829: error: Unsupported operand types for - ("Buffer" and "complex")  [operator]
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:829: error: Unsupported left operand type for - ("_SupportsArray[dtype[Any]]")  [operator]
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:829: error: Unsupported operand types for - ("_SupportsArray[dtype[Any]]" and "complex")  [operator]
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:829: error: Unsupported left operand type for - ("_NestedSequence[_SupportsArray[dtype[Any]]]")  [operator]
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:829: error: Unsupported operand types for - ("_NestedSequence[_SupportsArray[dtype[Any]]]" and "complex")  [operator]
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:829: error: Unsupported operand types for - ("complex" and "Buffer")  [operator]
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:829: error: Unsupported operand types for - ("complex" and "_SupportsArray[dtype[Any]]")  [operator]
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:829: error: Unsupported operand types for - ("complex" and "_NestedSequence[_SupportsArray[dtype[Any]]]")  [operator]
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:829: error: Unsupported operand types for - ("complex" and "bytes")  [operator]
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:829: error: Unsupported operand types for - ("complex" and "str")  [operator]
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:829: error: Unsupported operand types for - ("complex" and "_NestedSequence[complex | bytes | str]")  [operator]
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:829: error: Unsupported left operand type for - ("bytes")  [operator]
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:829: error: Unsupported operand types for - ("bytes" and "complex")  [operator]
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:829: error: Unsupported left operand type for - ("str")  [operator]
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:829: error: Unsupported operand types for - ("str" and "complex")  [operator]
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:829: error: Unsupported left operand type for - ("_NestedSequence[complex | bytes | str]")  [operator]
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:829: error: Unsupported operand types for - ("_NestedSequence[complex | bytes | str]" and "complex")  [operator]
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:829: note: Both left and right operands are unions
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:832: error: Argument 1 to "zip" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]"; expected "Iterable[_SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]]"  [arg-type]
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:832: error: Argument 1 to "zip" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]"; expected "Iterable[complex | bytes | str | _NestedSequence[complex | bytes | str] | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]]]"  [arg-type]
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:832: error: Argument 2 to "zip" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]"; expected "Iterable[complex | bytes | str | _NestedSequence[complex | bytes | str] | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]]]"  [arg-type]
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:832: error: Argument 2 to "zip" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]"; expected "Iterable[_SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]]"  [arg-type]
skore/src/skore/_sklearn/_plot/metrics/prediction_error.py:832: error: Argument 3 to "zip" has incompatible type "Any | complex"; expected "Iterable[Any]"  [arg-type]
skore/src/skore/_sklearn/_plot/metrics/precision_recall_curve.py:872: error: Value of type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]" is not indexable  [index]
skore/src/skore/_sklearn/_plot/metrics/precision_recall_curve.py:872: error: No overload variant of "__getitem__" of "bytes" matches argument type "tuple[slice[None, None, None], int]"  [call-overload]
skore/src/skore/_sklearn/_plot/metrics/precision_recall_curve.py:872: note: Possible overload variants:
skore/src/skore/_sklearn/_plot/metrics/precision_recall_curve.py:872: note:     def __getitem__(self, SupportsIndex, /) -> int
skore/src/skore/_sklearn/_plot/metrics/precision_recall_curve.py:872: note:     def __getitem__(self, slice[Any, Any, Any], /) -> bytes
skore/src/skore/_sklearn/_plot/metrics/precision_recall_curve.py:872: error: Invalid index type "tuple[slice[None, None, None], int]" for "_NestedSequence[_SupportsArray[dtype[Any]]]"; expected type "int"  [index]
skore/src/skore/_sklearn/_plot/metrics/precision_recall_curve.py:872: error: Invalid index type "tuple[slice[None, None, None], int]" for "str"; expected type "SupportsIndex | slice[Any, Any, Any]"  [index]
skore/src/skore/_sklearn/_plot/metrics/precision_recall_curve.py:872: error: Invalid index type "tuple[slice[None, None, None], int]" for "_NestedSequence[complex | bytes | str]"; expected type "int"  [index]
skore/src/skore/_sklearn/_plot/metrics/precision_recall_curve.py:878: error: Value of type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]" is not indexable  [index]
skore/src/skore/_sklearn/_plot/metrics/precision_recall_curve.py:878: error: No overload variant of "__getitem__" of "bytes" matches argument type "tuple[slice[None, None, None], int]"  [call-overload]
skore/src/skore/_sklearn/_plot/metrics/precision_recall_curve.py:878: note: Possible overload variants:
skore/src/skore/_sklearn/_plot/metrics/precision_recall_curve.py:878: note:     def __getitem__(self, SupportsIndex, /) -> int
skore/src/skore/_sklearn/_plot/metrics/precision_recall_curve.py:878: note:     def __getitem__(self, slice[Any, Any, Any], /) -> bytes
skore/src/skore/_sklearn/_plot/metrics/precision_recall_curve.py:878: error: Invalid index type "tuple[slice[None, None, None], int]" for "_NestedSequence[_SupportsArray[dtype[Any]]]"; expected type "int"  [index]
skore/src/skore/_sklearn/_plot/metrics/precision_recall_curve.py:878: error: Invalid index type "tuple[slice[None, None, None], int]" for "str"; expected type "SupportsIndex | slice[Any, Any, Any]"  [index]
skore/src/skore/_sklearn/_plot/metrics/precision_recall_curve.py:878: error: Invalid index type "tuple[slice[None, None, None], int]" for "_NestedSequence[complex | bytes | str]"; expected type "int"  [index]
skore/src/skore/_sklearn/_estimator/report.py:392: error: Argument "estimator_hash" to "_get_cached_response_values" has incompatible type "signedinteger[_64Bit]"; expected "int"  [arg-type]
skore/src/skore/_sklearn/_estimator/feature_importance_accessor.py:550: error: Item "Buffer" of "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]" has no attribute "shape"  [union-attr]
skore/src/skore/_sklearn/_estimator/feature_importance_accessor.py:550: error: Item "_SupportsArray[dtype[Any]]" of "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]" has no attribute "shape"  [union-attr]
skore/src/skore/_sklearn/_estimator/feature_importance_accessor.py:550: error: Item "_NestedSequence[_SupportsArray[dtype[Any]]]" of "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]" has no attribute "shape"  [union-attr]
skore/src/skore/_sklearn/_estimator/feature_importance_accessor.py:550: error: Item "complex" of "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]" has no attribute "shape"  [union-attr]
skore/src/skore/_sklearn/_estimator/feature_importance_accessor.py:550: error: Item "bytes" of "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]" has no attribute "shape"  [union-attr]
skore/src/skore/_sklearn/_estimator/feature_importance_accessor.py:550: error: Item "str" of "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]" has no attribute "shape"  [union-attr]
skore/src/skore/_sklearn/_estimator/feature_importance_accessor.py:550: error: Item "_NestedSequence[complex | bytes | str]" of "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]" has no attribute "shape"  [union-attr]
skore/src/skore/_sklearn/_comparison/report.py:410: error: List comprehension has incompatible type List[Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str] | list[Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]]]; expected List[Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]]  [misc]
skore/src/skore/_sklearn/_estimator/metrics_accessor.py:485: error: Argument "estimator_hash" to "_get_cached_response_values" has incompatible type "signedinteger[_64Bit]"; expected "int"  [arg-type]
skore/src/skore/_sklearn/_estimator/metrics_accessor.py:1677: error: Argument "estimator_hash" to "_get_cached_response_values" has incompatible type "signedinteger[_64Bit]"; expected "int"  [arg-type]
skore/src/skore/_sklearn/_cross_validation/metrics_accessor.py:1150: error: Argument "y" to "YPlotData" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | None"; expected "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]"  [arg-type]
skore/src/skore/_sklearn/_cross_validation/metrics_accessor.py:1155: error: Argument "estimator_hash" to "_get_cached_response_values" has incompatible type "signedinteger[_64Bit]"; expected "int"  [arg-type]
skore/src/skore/_sklearn/_cross_validation/data_accessor.py:45: error: Item "Buffer" of "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]" has no attribute "shape"  [union-attr]
skore/src/skore/_sklearn/_cross_validation/data_accessor.py:45: error: Item "_SupportsArray[dtype[Any]]" of "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]" has no attribute "shape"  [union-attr]
skore/src/skore/_sklearn/_cross_validation/data_accessor.py:45: error: Item "_NestedSequence[_SupportsArray[dtype[Any]]]" of "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]" has no attribute "shape"  [union-attr]
skore/src/skore/_sklearn/_cross_validation/data_accessor.py:45: error: Item "complex" of "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]" has no attribute "shape"  [union-attr]
skore/src/skore/_sklearn/_cross_validation/data_accessor.py:45: error: Item "str" of "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]" has no attribute "shape"  [union-attr]
skore/src/skore/_sklearn/_cross_validation/data_accessor.py:45: error: Item "_NestedSequence[complex | bytes | str]" of "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]" has no attribute "shape"  [union-attr]
skore/src/skore/_sklearn/_cross_validation/data_accessor.py:55: error: Item "Buffer" of "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]" has no attribute "ndim"  [union-attr]
skore/src/skore/_sklearn/_cross_validation/data_accessor.py:55: error: Item "_SupportsArray[dtype[Any]]" of "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]" has no attribute "ndim"  [union-attr]
skore/src/skore/_sklearn/_cross_validation/data_accessor.py:55: error: Item "_NestedSequence[_SupportsArray[dtype[Any]]]" of "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]" has no attribute "ndim"  [union-attr]
skore/src/skore/_sklearn/_cross_validation/data_accessor.py:55: error: Item "complex" of "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]" has no attribute "ndim"  [union-attr]
skore/src/skore/_sklearn/_cross_validation/data_accessor.py:55: error: Item "str" of "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]" has no attribute "ndim"  [union-attr]
skore/src/skore/_sklearn/_cross_validation/data_accessor.py:55: error: Item "_NestedSequence[complex | bytes | str]" of "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]" has no attribute "ndim"  [union-attr]
skore/src/skore/_sklearn/_cross_validation/data_accessor.py:58: error: Item "Buffer" of "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]" has no attribute "shape"  [union-attr]
skore/src/skore/_sklearn/_cross_validation/data_accessor.py:58: error: Item "_SupportsArray[dtype[Any]]" of "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]" has no attribute "shape"  [union-attr]
skore/src/skore/_sklearn/_cross_validation/data_accessor.py:58: error: Item "_NestedSequence[_SupportsArray[dtype[Any]]]" of "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]" has no attribute "shape"  [union-attr]
skore/src/skore/_sklearn/_cross_validation/data_accessor.py:58: error: Item "complex" of "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]" has no attribute "shape"  [union-attr]
skore/src/skore/_sklearn/_cross_validation/data_accessor.py:58: error: Item "str" of "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]" has no attribute "shape"  [union-attr]
skore/src/skore/_sklearn/_cross_validation/data_accessor.py:58: error: Item "_NestedSequence[complex | bytes | str]" of "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]" has no attribute "shape"  [union-attr]
```

Note that a complete typing review should be done in a next iteration.
@thomass-dev thomass-dev marked this pull request as ready for review October 28, 2025 13:36
Copy link
Contributor

@auguste-probabl auguste-probabl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK for me!

@thomass-dev thomass-dev merged commit 2eefa98 into main Oct 28, 2025
20 checks passed
@thomass-dev thomass-dev deleted the fix-pre-commit-mypy branch October 28, 2025 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants