Skip to content

Commit 217e239

Browse files
committed
fixed mypy error
1 parent 1928dc4 commit 217e239

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

codeflash/result/explanation.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import shutil
44
from io import StringIO
55
from pathlib import Path
6-
from typing import Optional
6+
from typing import Optional, cast
77

88
from pydantic.dataclasses import dataclass
99
from rich.console import Console
@@ -79,11 +79,11 @@ def to_console_string(self) -> str:
7979
f"{detail.expected_new_timing}",
8080
f"{detail.speedup_percent:.2f}%"
8181
)
82-
83-
# Render table to string - using actual terminal width
84-
console = Console(file=StringIO(), width=terminal_width)
82+
# Convert table to string
83+
string_buffer = StringIO()
84+
console = Console(file=string_buffer, width=terminal_width)
8585
console.print(table)
86-
benchmark_info = console.file.getvalue() + "\n"
86+
benchmark_info = cast(StringIO, console.file).getvalue() + "\n" # Cast for mypy
8787

8888
return (
8989
f"Optimized {self.function_name} in {self.file_path}\n"

0 commit comments

Comments
 (0)