code: def test_as_spark_schema_unspecified_codec_type_for_non_scalars_raises():
      """Do not currently support choosing spark type automatically for non-scalar types."""
      TestSchema = Unischema(
          "TestSchema",
          [
              UnischemaField(
                  "int_vector_unspecified_codec", np.int8, (1,)
              ),
          ],
      )
  
      with pytest.raises(ValueError, match="has codec set to None"):
          TestSchema.as_spark_schema()
  
imports: from __future__ import division
  from decimal import Decimal
  import numpy
  import pyarrow
  import pyarrow.parquet
  import pytest
  from pyspark import Row
  from pyspark.sql.types import StringType, IntegerType, DecimalType, ShortType, LongType
  from petastorm.codecs import ScalarCodec, NdarrayCodec
  from petastorm.unischema import Unischema, UnischemaField, dict_to_spark_row, insert_explicit_nulls, match_unischema_fields, _new_gt_255_compatible_namedtuple, _fullmatch
  from unittest import mock
label_desc: Use image node_id 4 for calling a global function with example usage: test_as_spark_schema_unspecified_codec_type_for_non_scalars_raises() without return types