code: def test_avro_compression(rows, codec):
      schema = {
          "name": "root",
          "type": "record",
          "fields": [
              {"name": "0", "type": "int"},
              {"name": "1", "type": "string"},
          ],
      }
  
      # N.B. rand_dataframe() is brutally slow for some reason.  Switching to
      #      np.random() speeds things up by a factor of 10.
      #      See also: https://github.com/rapidsai/cudf/issues/13128
      df = rand_dataframe(
          [
              {
                  "dtype": "int32",
                  "null_frequency": 0,
                  "cardinality": 1000,
              },
              {
                  "dtype": "str",
                  "null_frequency": 0,
                  "cardinality": 100,
                  "max_string_length": 10,
              },
          ],
          rows,
      )
      expected_df = cudf.DataFrame.from_arrow(df)
  
      records = df.to_pandas().to_dict(orient="records")
  
      buffer = io.BytesIO()
      fastavro.writer(buffer, schema, records, codec=codec)
      buffer.seek(0)
      got_df = cudf.read_avro(buffer)
  
      assert_eq(expected_df, got_df)
  
imports: import datetime
  import io
  import pathlib
  from typing import Optional
  import fastavro
  import numpy
  import pandas
  import pytest
  import cudf
  from cudf.testing._utils import assert_eq
  from cudf.testing.dataset_generator import rand_dataframe
label_desc: Use image node_id 9 for calling a global function with example usage: test_avro_compression(rows, codec) without return types