code: def test_empty_with_schema_struct() -> None:
      # Empty structs, with schema
      struct_schema = {"a": pl.Date, "b": pl.Boolean, "c": pl.Float64}
      frame_schema = {"x": pl.Int8, "y": pl.Struct(struct_schema)}
  
      @dataclass
      class TestData:
          x: int
          y: dict  # type: ignore[type-arg]
  
      # validate empty struct, null, and a mix of both
      for empty_structs in (
          [{}, {}],
          [{}, None],
          [None, {}],
          [None, None],
      ):
          # test init from rows, dicts, and dataclasses
          dict_data = {"x": [10, 20], "y": empty_structs}
          dataclass_data = [
              TestData(10, empty_structs[0]),  # type: ignore[index]
              TestData(20, empty_structs[1]),  # type: ignore[index]
          ]
          for frame_data in (dict_data, dataclass_data):
              df = pl.DataFrame(
                  data=frame_data,
                  schema=frame_schema,  # type: ignore[arg-type]
              )
              assert df.schema == frame_schema
              assert df.unnest("y").columns == ["x", "a", "b", "c"]
              assert df.rows() == [
                  (10, {"a": None, "b": None, "c": None}),
                  (20, {"a": None, "b": None, "c": None}),
              ]
  
imports: from __future__ import annotations
  from dataclasses import dataclass
  from datetime import datetime, time
  from typing import TYPE_CHECKING
  import pandas
  import pyarrow
  import pytest
  import polars
  import polars.selectors
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 36 for calling a global function with example usage: test_empty_with_schema_struct() without return types