code: def _assert_lossless_adapter(
      spark,
      tmp_path,
      hail_df,
      input_file,
      in_fmt,
      out_fmt,
      writer_options={},
      reader_options={},
  ):
      # Convert Hail MatrixTable to Glow DataFrame and write it to a flat file
      output_file = (tmp_path / "tmp").as_uri() + "." + in_fmt
      writer = hail_df.write.format(out_fmt)
      for key, value in writer_options.items():
          writer = writer.option(key, value)
      writer.save(output_file)
  
      # Assert that reread DF has the same schema (excluding metadata/order)
      reader = spark.read.format(in_fmt)
      for key, value in reader_options.items():
          reader = reader.option(key, value)
      round_trip_df = reader.load(output_file)
      glow_df = reader.load(input_file)
      _compare_struct_types(glow_df.schema, round_trip_df.schema)
  
      # Assert that no data is lost
      matching_df = (
          spark.read.format(in_fmt)
          .schema(glow_df.schema)
          .load(output_file)
      )
      assert matching_df.subtract(glow_df).count() == 0
      assert glow_df.subtract(matching_df).count() == 0
  
file_path: glow/python/glow/hail/tests/test_from_matrix_table.py
imports: from glow.hail import functions
  import hail
  from pyspark.sql import functions
  from pyspark.sql.types import ArrayType, StructType
  import pytest
label_desc: Use image node_id 2 for calling a global function with example usage: _assert_lossless_adapter(spark, tmp_path, hail_df, input_file, in_fmt, out_fmt, writer_options, reader_options) without return types