gigl.src.validation_check.libs.utils#

Functions#

assert_proto_field_value_is_truthy(proto, field_name)

Assert that a proto field is not empty. Throws an AssertionError if the field is not set or if the value in the field is equal to the default value.

assert_proto_has_field(proto, field_name)

Assert that a proto has a defined field. Throws an AssertionError if the field is not set.

Module Contents#

gigl.src.validation_check.libs.utils.assert_proto_field_value_is_truthy(proto, field_name)[source]#

Assert that a proto field is not empty. Throws an AssertionError if the field is not set or if the value in the field is equal to the default value.

Parameters:
  • proto (google.protobuf.message.Message) – A proto message.

  • field_name (str) – A string representing the field name.

Return type:

None

gigl.src.validation_check.libs.utils.assert_proto_has_field(proto, field_name)[source]#

Assert that a proto has a defined field. Throws an AssertionError if the field is not set. Note: this method only works for message fields, not for singular (non-message) fields.

Parameters:
  • proto (google.protobuf.message.Message) – A proto message.

  • field_name (str) – A string representing the field name.

Return type:

None