Skip to content

Commit

Permalink
add temporary solution for ndjson
Browse files Browse the repository at this point in the history
  • Loading branch information
coastalwhite committed Feb 13, 2025
1 parent 7166d94 commit db64124
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions py-polars/tests/unit/io/test_multiscan.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import io
import os
from typing import TYPE_CHECKING, Any, Callable

import pytest
Expand Down Expand Up @@ -342,6 +343,10 @@ def test_multiscan_head(
write: Callable[[pl.DataFrame, io.BytesIO | Path], Any],
ext: str,
) -> None:
if ext == 'ndjson' and os.environ['POLARS_AUTO_NEW_STREAMING'] == '1':
msg = "NYI"
raise Exception(msg) # noqa: TRY002

a = io.BytesIO()
b = io.BytesIO()
for f in [a, b]:
Expand Down Expand Up @@ -377,6 +382,10 @@ def test_multiscan_tail(
write: Callable[[pl.DataFrame, io.BytesIO | Path], Any],
ext: str,
) -> None:
if ext == 'ndjson' and os.environ['POLARS_AUTO_NEW_STREAMING'] == '1':
msg = "NYI"
raise Exception(msg) # noqa: TRY002

a = io.BytesIO()
b = io.BytesIO()
for f in [a, b]:
Expand Down Expand Up @@ -412,6 +421,10 @@ def test_multiscan_slice_middle(
write: Callable[[pl.DataFrame, io.BytesIO | Path], Any],
ext: str,
) -> None:
if ext == 'ndjson' and os.environ['POLARS_AUTO_NEW_STREAMING'] == '1':
msg = "NYI"
raise Exception(msg) # noqa: TRY002

fs = [io.BytesIO() for _ in range(13)]
for f in fs:
write(pl.Series("c1", range(7)).to_frame(), f)
Expand All @@ -427,3 +440,4 @@ def test_multiscan_slice_middle(
scan(fs).slice(5 * 7 - 5, 17).collect(new_streaming=True), # type: ignore[call-overload]
pl.Series("c1", expected).to_frame(),
)

0 comments on commit db64124

Please sign in to comment.