Check if specific fields exists in matrix table in python script

I am trying to run the below on a small Exome matrix table

def filter_matrix_table(self):"Filtering matrix table")
    mt = hl.read_matrix_table(self.input_matrix_table)
    # memoize the loci we care about
    mt = mt.annotate_globals(fp_loci=self.get_loci_from_sites_path())
    # filter and grab what we need
    mt = mt.filter_rows(mt.fp_loci.contains(
    mt = mt.drop('info', 'fp_loci')
    return mt.select_entries('GT', 'PL')

I am getting back

Traceback (most recent call last):
  File "/tmp/1d77d8061d704092bf4a465ab1d44975/", line 63, in <module>
  File "/tmp/1d77d8061d704092bf4a465ab1d44975/", line 44, in run
    mt = self.filter_matrix_table()
  File "/tmp/1d77d8061d704092bf4a465ab1d44975/", line 36, in filter_matrix_table
    mt = mt.drop('info', 'fp_loci')
  File "<decorator-gen-1185>", line 2, in drop
  File "/opt/conda/default/lib/python3.6/site-packages/hail/typecheck/", line 614, in wrapper
    return __original_func(*args_, **kwargs_)
  File "/opt/conda/default/lib/python3.6/site-packages/hail/", line 1315, in drop
    raise IndexError("MatrixTable has no field '{}'".format(e))
IndexError: MatrixTable has no field 'info'

I think I should be able to run describe or summarize to see if ‘info’ or other fields needs to be removed (should I expect it to be there?), but I am having some trouble finding how I can run that in a python script and grab fields as a list.

Just for clarity, I have already confirmed there is no info field in this specific matrix table using describe and seeing the output, but I would like a way for the script to check on its own without manual intervention.

You can get the fields of a MatrixTable component with:


Or check for membership with:

field in mt.row


Thank you, that worked! Have a great break.