code: def test_weekday(time_unit: TimeUnit) -> None:
      friday = pl.Series([datetime(2023, 2, 17)])
  
      assert friday.dt.cast_time_unit(time_unit).dt.weekday()[0] == 5
      assert friday.cast(pl.Date).dt.weekday()[0] == 5
  
imports: from __future__ import annotations
  import sys
  from datetime import date, datetime, time, timedelta
  from typing import TYPE_CHECKING
  import pytest
  import polars
  from polars.datatypes import DTYPE_TEMPORAL_UNITS
  from polars.dependencies import _ZONEINFO_AVAILABLE
  from polars.exceptions import ComputeError, InvalidOperationError
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 45 for calling a global function with example usage: test_weekday(time_unit) without return types