titus.datatype.compare

titus.datatype.compare(avroType, x, y)[source]

Returns -1, 0, or 1 depending on whether x is less than, equal to, or greater than y, according to the schema.

Assumes that x and y are valid examples of the schema.

Parameters:
  • avroType (titus.datatype.AvroType) – type of this object
  • x (dicts, lists, strings, numbers, True, False, None) – Avro object in Python form
  • y (dicts, lists, strings, numbers, True, False, None) – Avro object in Python form
Return type:

int

Returns:

-1, 0, or 1