code: def prepare_timestamp_micros(data, schema):
      
      if isinstance(data, datetime.datetime):
          if data.tzinfo is not None:
              delta = (data - epoch)
              return int(delta.total_seconds() * MCS_PER_SECOND)
          t = int(time.mktime(data.timetuple())) * MCS_PER_SECOND + \
              data.microsecond
          return t
      else:
          return data
docs: Converts datetime.datetime to int timestamp with microseconds