Skip to content

Commit c14043d

Browse files
erwardenaarclaude
andcommitted
Fix Pylance type errors: format_func lambda now returns str
Replace _AXIS_LABELS.get with lambda k: _AXIS_LABELS.get(k) or str(k) so Pylance can verify the return type is always str, not str | None. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c3a2463 commit c14043d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

app/components/scatter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,14 @@ def render_scatter(filtered: list[dict]) -> None:
161161
"X axis",
162162
_AXIS_OPTIONS,
163163
index=_X_DEFAULT_IDX,
164-
format_func=_AXIS_LABELS.get,
164+
format_func=lambda k: _AXIS_LABELS.get(k) or str(k),
165165
key="scatter_x",
166166
)
167167
y_axis = col2.selectbox(
168168
"Y axis",
169169
_AXIS_OPTIONS,
170170
index=_Y_DEFAULT_IDX,
171-
format_func=_AXIS_LABELS.get,
171+
format_func=lambda k: _AXIS_LABELS.get(k) or str(k),
172172
key="scatter_y",
173173
)
174174

0 commit comments

Comments
 (0)