Пример #1
0
    def test_sequence_feature_column_name_not_struct_in_schema(self):
        schema_text_proto = """
        feature {
          name: "##SEQUENCE##"
          type: INT
        }
        """
        serialized_schema = text_format.Parse(
            schema_text_proto, schema_pb2.Schema()).SerializeToString()

        error_msg_regex = (
            "Found a feature in the schema with the sequence_feature_column_name "
            r"\(i.e., ##SEQUENCE##\) that is not a struct.*")

        with self.assertRaisesRegex(RuntimeError, error_msg_regex):
            sequence_example_coder.SequenceExamplesToRecordBatchDecoder(
                _TEST_SEQUENCE_COLUMN_NAME, serialized_schema)
Пример #2
0
 def _ArrowSchemaNoRawRecordColumn(self) -> pa.Schema:
     return sequence_example_coder.SequenceExamplesToRecordBatchDecoder(
         _SEQUENCE_COLUMN_NAME,
         self._schema.SerializeToString(),
         use_large_types=self._can_produce_large_types).ArrowSchema()