code: def data_to_b64(self, **data):
      sink = pa.BufferOutputStream()
      field_list = []
      data_list = []
      for key, value in data.items():
          field, data = get_field_and_data(key, value)
          field_list.append(field)
          data_list.append(data)
  
      schema = pa.schema(field_list)
      batch = pa.RecordBatch.from_arrays(data_list, schema)
  
      writer = pa.RecordBatchStreamWriter(sink, batch.schema)
      writer.write_batch(batch)
      writer.close()
      buf = sink.getvalue()
      b = buf.to_pybytes()
      b64str = self.base64_encode_image(b)
      return b64str
  
imports: import redis
  import time
  from bigdl.serving.schema import *
  import httpx
  import json
  import uuid
  from bigdl.serving.log4Error import invalidInputError
label_desc: Use image node_id 4 for calling the InputQueue obj's underlying member method code with example usage: obj.data_to_b64() and returns: b64str