code: def test_datetime_range_schema_upcasts_to_datetime(
      input_time_unit: TimeUnit | None,
      input_time_zone: str | None,
      output_dtype: PolarsDataType,
      interval: str,
      expected_datetime_range: list[str],
  ) -> None:
      df = pl.DataFrame(
          {"start": [date(2020, 1, 1)], "end": [date(2020, 1, 3)]}
      ).lazy()
      result = df.with_columns(
          datetime_range=pl.datetime_ranges(
              pl.col("start"),
              pl.col("end"),
              interval=interval,
              time_unit=input_time_unit,
              time_zone=input_time_zone,
          )
      )
      expected_schema = {
          "start": pl.Date,
          "end": pl.Date,
          "datetime_range": pl.List(output_dtype),
      }
      assert result.schema == expected_schema
      assert result.collect().schema == expected_schema
  
      expected = pl.DataFrame(
          {
              "start": [date(2020, 1, 1)],
              "end": [date(2020, 1, 3)],
              "datetime_range": pl.Series(expected_datetime_range)
              .str.to_datetime(time_unit="ns")
              .implode(),
          }
      ).with_columns(
          pl.col("datetime_range")
          .explode()
          .dt.cast_time_unit(output_dtype.time_unit)  # type: ignore[union-attr]
          .dt.replace_time_zone(output_dtype.time_zone)  # type: ignore[union-attr]
          .implode(),
      )
      assert_frame_equal(result.collect(), expected)
  
      # check datetime_range too
      result_single = pl.datetime_range(
          date(2020, 1, 1),
          date(2020, 1, 3),
          interval=interval,
          time_unit=input_time_unit,
          time_zone=input_time_zone,
          eager=True,
      ).alias("datetime")
      assert_series_equal(
          result_single,
          expected["datetime_range"].explode().rename("datetime"),
      )
  
imports: from __future__ import annotations
  from datetime import date, datetime, timedelta
  from typing import TYPE_CHECKING
  import pytest
  import polars
  from polars.datatypes import DTYPE_TEMPORAL_UNITS
  from polars.exceptions import ComputeError, TimeZoneAwareConstructorWarning
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 14 for calling a global function with example usage: test_datetime_range_schema_upcasts_to_datetime(input_time_unit, input_time_zone, output_dtype, interval, expected_datetime_range) without return types