Fields versus methods in expression language

In the new expression language documentation, we distinguish between fields and methods on Types.

Fields

  • Attributes of an object
  • Do not have parentheses

Methods

  • Function calls on an object
  • Do require parentheses

Example

variants.filter(v => v.contig == "X" && v.isBiallelic()).count()

contig is a field on Variant, isBiallelic() is a method on Variant, and count() is a method on Aggregable.

In the near future, Hail will enforce the difference between fields and methods, throwing an error for expressions like x.toInt and gs.count.