code: def test_conversion_dtype() -> None:
      df = (
          pl.DataFrame(
              {
                  "id_column": [1, 2, 3, 4],
                  "some_column": ["a", "b", "c", "d"],
                  "some_partition_column": [
                      "partition_1",
                      "partition_2",
                      "partition_1",
                      "partition_2",
                  ],
              }
          )
          .select(
              pl.struct(
                  pl.col("id_column"),
                  pl.col("some_column").cast(pl.Categorical),
              ).alias("struct"),
              pl.col("some_partition_column"),
          )
          .group_by("some_partition_column", maintain_order=True)
          .agg("struct")
      )
  
      result: pl.DataFrame = pl.from_arrow(df.to_arrow())  # type: ignore[assignment]
      # the assertion is not the real test
      # this tests if dtype has bubbled up correctly in conversion
      # if not we would UB
      expected = {
          "some_partition_column": ["partition_1", "partition_2"],
          "struct": [
              [
                  {"id_column": 1, "some_column": "a"},
                  {"id_column": 3, "some_column": "c"},
              ],
              [
                  {"id_column": 2, "some_column": "b"},
                  {"id_column": 4, "some_column": "d"},
              ],
          ],
      }
      assert result.to_dict(as_series=False) == expected
  
file_path: polars/py-polars/tests/unit/test_datatypes.py
imports: from __future__ import annotations
  import pickle
  from datetime import datetime, timedelta
  from typing import TYPE_CHECKING
  import pytest
  import polars
  from polars import datatypes
  from polars.datatypes import DTYPE_TEMPORAL_UNITS, DataTypeGroup, Field, Int64, List, Struct, py_type_to_dtype
label_desc: Use image node_id 11 for calling a global function with example usage: test_conversion_dtype() without return types