Skip to content

Commit bcb13c9

Browse files
committed
fix: handle Windows drive letters in get_parquet_indexer_cls
1 parent bac1292 commit bcb13c9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/litdata/utilities/parquet.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,12 @@ def get_parquet_indexer_cls(
326326

327327
obj = parse.urlparse(dir_path)
328328

329-
if obj.scheme in ("local", ""):
329+
# On Windows, paths like "C:\\Users\\..." parse with scheme='c'. A single-letter
330+
# scheme is never a valid URI scheme (RFC 3986 requires >=2 chars) so treat it
331+
# as a Windows drive letter and dispatch to LocalParquetDir.
332+
is_windows_drive = len(obj.scheme) == 1 and obj.scheme.isalpha()
333+
334+
if obj.scheme in ("local", "") or is_windows_drive:
330335
return LocalParquetDir(*args)
331336
if obj.scheme in ("gs", "s3"):
332337
return CloudParquetDir(*args)

0 commit comments

Comments
 (0)