Skip to content

Commit 7d73981

Browse files
committed
use first 10 non null values only to infer format
1 parent 260ea69 commit 7d73981

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

narwhals/_arrow/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ def parse_datetime_format(arr: pa.StringArray) -> str:
362362
import pyarrow.compute as pc # ignore-banned-import
363363

364364
matches = pa.concat_arrays( # converts from ChunkedArray to StructArray
365-
pc.extract_regex(arr, pattern=FULL_RE).chunks
365+
pc.extract_regex(pc.drop_null(arr).slice(0, 10), pattern=FULL_RE).chunks
366366
)
367367

368368
if not pc.all(matches.is_valid()).as_py():

0 commit comments

Comments
 (0)