Skip to content

Conversation

@thomass-dev
Copy link
Collaborator

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

Prerequisite for #2069.

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-actions
Copy link
Contributor

github-actions bot commented Oct 21, 2025

Coverage

Coverage Report for skore-hub-project/
FileStmtsMissCoverMissing
skore-hub-project/src/skore_hub_project
   __init__.py22195%39
   protocol.py290100% 
skore-hub-project/src/skore_hub_project/artifact
   __init__.py00100% 
   artifact.py230100% 
   serializer.py260100% 
   upload.py36488%175, 177–178, 180
skore-hub-project/src/skore_hub_project/artifact/media
   __init__.py50100% 
   data.py220100% 
   feature_importance.py340100% 
   media.py100100% 
   model.py90100% 
   performance.py440100% 
skore-hub-project/src/skore_hub_project/artifact/pickle
   __init__.py20100% 
   pickle.py240100% 
skore-hub-project/src/skore_hub_project/authentication
   __init__.py00100% 
   login.py210100% 
   logout.py50100% 
   token.py180100% 
skore-hub-project/src/skore_hub_project/client
   __init__.py00100% 
   api.py470100% 
   client.py640100% 
skore-hub-project/src/skore_hub_project/metric
   __init__.py100100% 
   accuracy.py350100% 
   brier_score.py350100% 
   log_loss.py350100% 
   metric.py49197%25
   precision.py630100% 
   r2.py350100% 
   recall.py630100% 
   rmse.py350100% 
   roc_auc.py350100% 
   timing.py90495%52–53, 115–116
skore-hub-project/src/skore_hub_project/project
   __init__.py00100% 
   project.py102397%204, 308, 338
skore-hub-project/src/skore_hub_project/report
   __init__.py30100% 
   cross_validation_report.py64198%204
   estimator_report.py120100% 
   report.py520100% 
TOTAL11591498% 

Tests Skipped Failures Errors Time
136 0 💤 0 ❌ 0 🔥 1m 32s ⏱️

@thomass-dev thomass-dev requested review from rouk1 and removed request for rouk1 October 21, 2025 12:58
@thomass-dev thomass-dev force-pushed the skore-hub-project-fix-typing branch from e358d85 to 6d8cde9 Compare October 21, 2025 13:22
@thomass-dev thomass-dev force-pushed the skore-hub-project-fix-typing branch from 6d8cde9 to ec974af Compare October 21, 2025 13:57
@thomass-dev thomass-dev marked this pull request as ready for review October 21, 2025 14:03
Copy link
Contributor

@rouk1 rouk1 left a comment

Choose a reason for hiding this comment

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

Very nice!

@rouk1 rouk1 added this pull request to the merge queue Oct 21, 2025
Merged via the queue into main with commit 0169d9c Oct 21, 2025
36 checks passed
@rouk1 rouk1 deleted the skore-hub-project-fix-typing branch October 21, 2025 16:19
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