code: def test_as_spark_schema_unspecified_codec_type_unknown_scalar_type_raises():
      """We have a limited list of scalar types we can automatically map from numpy (+Decimal) types to spark types.
      Make sure that a ValueError is raised if an unknown type is used.
      """
      TestSchema = Unischema(
          "TestSchema",
          [
              UnischemaField(
                  "int_vector_unspecified_codec", object, ()
              ),
          ],
      )
  
      with pytest.raises(ValueError, match="Was not able to map type"):
          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 5 for calling a global function with example usage: test_as_spark_schema_unspecified_codec_type_unknown_scalar_type_raises() without return types