Skip to content

Commit 98858fd

Browse files
authored
chore: Add support for Narwhals Binary dtype in serialize_dtype (#1928)
1 parent da5fed7 commit 98858fd

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

shiny/render/_data_frame_utils/_tbl_data.py

+6
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,12 @@ def serialize_dtype(col: nw.Series) -> FrameDtype:
208208
nw.Time, # pyright: ignore[reportUnknownMemberType,reportAttributeAccessIssue]
209209
):
210210
type_ = "time"
211+
elif hasattr(nw, "Binary") and isinstance(
212+
dtype,
213+
# https://github.com/narwhals-dev/narwhals/pull/2243
214+
nw.Binary, # pyright: ignore[reportUnknownMemberType,reportAttributeAccessIssue]
215+
):
216+
type_ = "binary"
211217
elif isinstance(dtype, nw.Object):
212218
type_ = "object"
213219
if series_contains_htmltoolslike(col):

shiny/render/_data_frame_utils/_types.py

+1
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ class FrameDtypeSubset(TypedDict):
184184
"object",
185185
"unknown",
186186
"html",
187+
"binary",
187188
]
188189

189190

0 commit comments

Comments
 (0)