Skip to content

Commit 4b9cada

Browse files
committed
mypy
1 parent a2fb0ae commit 4b9cada

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

onnx_diagnostic/helpers/log_helper.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def load(self, verbose: int = 0):
260260
assert self.values, f"No values found with {self._values} from {self.data.columns}"
261261
assert not (
262262
set(self.keys_no_time) & set(self.values)
263-
), f"Columns {set(self.keys) & set(self.values)} cannot be keys and values"
263+
), f"Columns {set(self.keys_no_time) & set(self.values)} cannot be keys and values"
264264
assert not (
265265
set(self.keys_no_time) & set(self.ignored)
266266
), f"Columns {set(self.keys_no_time) & set(self.ignored)} cannot be keys and ignored"
@@ -328,7 +328,8 @@ def load(self, verbose: int = 0):
328328

329329
def _process_formula(
330330
self, formula: Union[str, Callable[[pandas.DataFrame], pandas.Series]]
331-
) -> Union[str, Callable[[pandas.DataFrame], pandas.Series]]:
331+
) -> Callable[[pandas.DataFrame], pandas.Series]:
332+
assert callable(formula), f"formula={formula!r} is not supported."
332333
return formula
333334

334335
@property
@@ -616,7 +617,7 @@ def describe(self) -> pandas.DataFrame:
616617
def to_excel(
617618
self,
618619
output: str,
619-
views: Union[Sequence[str], Dict[str, CubeViewDef]],
620+
views: Union[Sequence[str], Dict[str, Union[str, CubeViewDef]]],
620621
main: Optional[str] = "main",
621622
raw: Optional[str] = "raw",
622623
verbose: int = 0,
@@ -979,7 +980,7 @@ def make_view_def(self, name: str) -> CubeViewDef:
979980
}
980981
assert name in implemented_views, (
981982
f"Unknown view {name!r}, expected a name in {sorted(implemented_views)},"
982-
f"\n--\nkeys={pprint.pformat(sorted(self.keys))}, "
983+
f"\n--\nkeys={pprint.pformat(sorted(self.keys_time))}, "
983984
f"\n--\nvalues={pprint.pformat(sorted(self.values))}"
984985
)
985986
return implemented_views[name]()

0 commit comments

Comments
 (0)