class_docstr: ArrowDatasetTest
class_docstr_tok: ["ArrowDatasetTest"]
docstr: run_test_case
code: def run_test_case(self, dataset, truth_data, batch_size=None):
      """run_test_case"""
  
      def is_float(dtype):
          """Check if dtype is a floating-point"""
          return dtype in [
              tf.dtypes.float16,
              tf.dtypes.float32,
              tf.dtypes.float64,
          ]
  
      def evaluate_result(value):
          """Check the results match truth data"""
          for i, col in enumerate(dataset.columns):
              if truth_data.output_shapes[col].ndims == 0:
                  if is_float(truth_data.output_types[col]):
                      self.assertAlmostEqual(
                          value[i], truth_data.data[col][row], 4
                      )
                  else:
                      self.assertEqual(
                          value[i], truth_data.data[col][row]
                      )
              elif truth_data.output_shapes[col].ndims == 1:
                  if is_float(truth_data.output_types[col]):
                      for j, v in enumerate(value[i]):
                          self.assertAlmostEqual(
                              v, truth_data.data[col][row][j], 4
                          )
                  else:
                      self.assertListEqual(
                          value[i].tolist(), truth_data.data[col][row]
                      )
  
      # Row counter for each single result or batch of multiple rows
      row = 0
  
      # Iterate over the dataset
      for results in dataset:
          # For batches, iterate over each row in batch or remainder at end
          for result_idx in range(batch_size or 1):
              # Get a single row value
              if batch_size is None:
                  value = [r.numpy() for r in results]
              # Get a batch of values and check 1 row at a time
              else:
                  if result_idx == 0:
                      value_batch = [r.numpy() for r in results]
  
                  # Check for a partial result
                  if result_idx == value_batch[0].shape[0]:
                      break
  
                  # Get a single row out of the batch
                  value = [v[result_idx] for v in value_batch]
  
              # Check the result then increment the row counter
              evaluate_result(value)
              row += 1
  
      # Check that all data was returned by Dataset
      self.assertEqual(row, len(truth_data.data[0]))
  
imports: from collections import namedtuple
  import io
  import os
  import socket
  import tempfile
  import threading
  import pytest
  import pyarrow
  import numpy.testing
  import tensorflow
  import tensorflow_io
label_desc: Use image node_id 1 for calling the ArrowDatasetTest obj's underlying member method code with example usage: obj.run_test_case(dataset, truth_data, batch_size) and returns: unknown