code: def test_parquet_graph():
      """Test case for parquet in graph mode."""
  
      # test parquet dataset
      @tf.function(autograph=False)
      def f(e):
          columns = {
              "boolean_field": tf.bool,
              "int32_field": tf.int32,
              "int64_field": tf.int64,
              "float_field": tf.float32,
              "double_field": tf.float64,
              "ba_field": tf.string,
              "flba_field": tf.string,
          }
          dataset = tfio.IODataset.from_parquet(e, columns)
          dataset = dataset.batch(500)
          return tf.data.experimental.get_single_element(dataset)
  
      data = f(filename)
  
      for i in range(500):
          v0 = (i % 2) == 0
          v1 = i
          v2 = i * 1000 * 1000 * 1000 * 1000
          v4 = 1.1 * i
          v5 = 1.1111111 * i
          v6 = b"parquet%03d" % i
          v7 = bytearray(b"").join(
              [bytearray((i % 256,)) for _ in range(10)]
          )
          p0 = data["boolean_field"][i]
          p1 = data["int32_field"][i]
          p2 = data["int64_field"][i]
          p4 = data["float_field"][i]
          p5 = data["double_field"][i]
          p6 = data["ba_field"][i]
          p7 = data["flba_field"][i]
          assert v0 == p0.numpy()
          assert v1 == p1.numpy()
          assert v2 == p2.numpy()
          assert np.isclose(v4, p4.numpy())
          assert np.isclose(v5, p5.numpy())
          assert v6 == p6.numpy()
          assert v7 == p7.numpy()
  
file_path: io/tests/test_parquet.py
imports: import os
  import collections
  import numpy
  import tensorflow
  import tensorflow_io
  import pandas
label_desc: Use image node_id 6 for calling a global function with example usage: test_parquet_graph() and returns: tf