docs: def parse_condition(
      cond, selectable, aggregated=False, default_aggregation='sum'
  ):
      """Create a SQLAlchemy clause from a condition."""
      if cond is None:
          return None
  
      else:
          if 'and' in cond:
              conditions = [
                  parse_condition(
                      c, selectable, aggregated, default_aggregation
                  ) for c in cond['and']
              ]
              return and_(*conditions)
          elif 'or' in cond:
              conditions = [
                  parse_condition(
                      c, selectable, aggregated, default_aggregation
                  ) for c in cond['or']
              ]
              return or_(*conditions)
          elif 'field' not in cond:
              raise BadIngredient('field must be defined in condition')
          field = parse_field(
              cond['field'],
              selectable,
              aggregated=aggregated,
              default_aggregation=default_aggregation
          )
          if 'in' in cond:
              value = cond['in']
              if isinstance(value, dict):
                  raise BadIngredient('value for in must be a list')
              condition_expression = getattr(field, 'in_')(tuple(value))
          elif 'gt' in cond:
              value = cond['gt']
              if isinstance(value, (list, dict)):
                  raise BadIngredient('conditional value must be a scalar')
              condition_expression = getattr(field, '__gt__')(value)
          elif 'gte' in cond:
              value = cond['gte']
              if isinstance(value, (list, dict)):
                  raise BadIngredient('conditional value must be a scalar')
              condition_expression = getattr(field, '__ge__')(value)
          elif 'lt' in cond:
              value = cond['lt']
              if isinstance(value, (list, dict)):
                  raise BadIngredient('conditional value must be a scalar')
              condition_expression = getattr(field, '__lt__')(value)
          elif 'lte' in cond:
              value = cond['lte']
              if isinstance(value, (list, dict)):
                  raise BadIngredient('conditional value must be a scalar')
              condition_expression = getattr(field, '__le__')(value)
          elif 'eq' in cond:
              value = cond['eq']
              if isinstance(value, (list, dict)):
                  raise BadIngredient('conditional value must be a scalar')
              condition_expression = getattr(field, '__eq__')(value)
          elif 'ne' in cond:
              value = cond['ne']
              if isinstance(value, (list, dict)):
                  raise BadIngredient('conditional value must be a scalar')
              condition_expression = getattr(field, '__ne__')(value)
          else:
              raise BadIngredient('Bad condition')
  
          return condition_expression