code: def test_scan_ndjson_with_schema(foods_ndjson_path: Path) -> None:
      schema = {
          "category": pl.Categorical,
          "calories": pl.Int64,
          "fats_g": pl.Float64,
          "sugars_g": pl.Int64,
      }
      df = pl.scan_ndjson(foods_ndjson_path, schema=schema).collect()
      assert df["category"].dtype == pl.Categorical
      assert df["calories"].dtype == pl.Int64
      assert df["fats_g"].dtype == pl.Float64
      assert df["sugars_g"].dtype == pl.Int64
  
      schema["sugars_g"] = pl.Float64
      df = pl.scan_ndjson(foods_ndjson_path, schema=schema).collect()
      assert df["sugars_g"].dtype == pl.Float64
  
file_path: polars/py-polars/tests/unit/io/test_lazy_json.py
imports: from __future__ import annotations
  from typing import TYPE_CHECKING
  import pytest
  import polars
  from polars.testing import assert_frame_equal
label_desc: Use image node_id 3 for calling a global function with example usage: test_scan_ndjson_with_schema(foods_ndjson_path) without return types