Skip to content

Commit

Permalink
Fix broken type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
PGijsbers committed Aug 28, 2024
1 parent 1a04502 commit 18f879d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions amlb/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import os
import re
import statistics
from typing import Union
from typing import Union, cast

import numpy as np
from numpy import nan, sort
Expand Down Expand Up @@ -297,7 +297,7 @@ def save_predictions(dataset: Dataset, output_file: str,
if isinstance(predictions, S):
predictions = predictions.values
if scipy.sparse.issparse(truth) and truth.shape[1] == 1:
truth = pd.DataFrame(truth.todense())
truth = pd.DataFrame(cast(scipy.sparse.sparray, truth).todense())
if isinstance(truth, DF):
truth = truth.squeeze()
if isinstance(truth, S):
Expand Down
2 changes: 1 addition & 1 deletion amlb/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def yaml_load(file, as_namespace=False):
yaml = YAML(typ='safe')
return yaml.load(file)
else:
def yaml_load(*_, **__):
def yaml_load(*_, **__): # type: ignore[misc]
raise ImportError("ruamel.yaml package is required to load `yaml` config files.")


Expand Down

0 comments on commit 18f879d

Please sign in to comment.