code: def check_range_key(query_on, key):
      
      return (
          isinstance(key, BaseCondition) and
          key.operation in ("begins_with", "between", "<", ">", "<=", ">=", "==") and
          key.column is query_on.range_key
      )
docs: BeginsWith, Between, or any Comparison except '!=' against query_on.range_key