Repository: apache/superset
File: superset/db_engine_specs/base.py (Python)

Code before:
        if cls.use_equality_for_boolean_filters:
            return sqla_col == value
        else:
            return sqla_col.is_(value)

    @classmethod
    def handle_null_filter(cls, sqla_col: Any, op: str) -> BinaryExpression:
        """
        Handle null/not null filter operations.

        :param sqla_col: SQLAlchemy column element
        :param op: Filter operator (IS_NULL or IS_NOT_NULL)
        :return: SQLAlchemy expression for the null filter
        """
        from superset.utils import core as utils

        if op == utils.FilterOperator.IS_NULL.value:
            return sqla_col.is_(None)
        elif op == utils.FilterOperator.IS_NOT_NULL.value:
            return sqla_col.isnot(None)
        else:
            raise ValueError(f"Invalid null filter operator: {op}")

    @classmethod
    def handle_comparison_filter(
        cls, sqla_col: Any, op: str, value: Any
    ) -> BinaryExpression:
        """
        Handle comparison filter operations (=, !=, >, <, >=, <=).

        :param sqla_col: SQLAlchemy column element
        :param op: Filter operator
        :param value: Filter value
        :return: SQLAlchemy expression for the comparison filter
        """
        from superset.utils import core as utils

        if op == utils.FilterOperator.EQUALS.value:
            return sqla_col == value
        elif op == utils.FilterOperator.NOT_EQUALS.value:
            return sqla_col != value
        elif op == utils.FilterOperator.GREATER_THAN.value:
            return sqla_col > value
        elif op == utils.FilterOperator.LESS_THAN.value:
            return sqla_col < value
        elif op == utils.FilterOperator.GREATER_THAN_OR_EQUALS.value:
            return sqla_col >= value
        elif op == utils.FilterOperator.LESS_THAN_OR_EQUALS.value:
            return sqla_col <= value
        else:
            raise ValueError(f"Invalid comparison filter operator: {op}")

Review comment (suggestion):
Same here:

```suggestion
        cls, sqla_col: Any, op: utils.FilterOperator, value: Any
```

Code after:
        if cls.use_equality_for_boolean_filters:
            return sqla_col == value
        else:
            return sqla_col.is_(value)

    @classmethod
    def handle_null_filter(
        cls,
        sqla_col: Any,
        op: utils.FilterOperator,
    ) -> BinaryExpression:
        """
        Handle null/not null filter operations.

        :param sqla_col: SQLAlchemy column element
        :param op: Filter operator (IS_NULL or IS_NOT_NULL)
        :return: SQLAlchemy expression for the null filter
        """
        from superset.utils import core as utils

        if op == utils.FilterOperator.IS_NULL:
            return sqla_col.is_(None)
        elif op == utils.FilterOperator.IS_NOT_NULL:
            return sqla_col.isnot(None)
        else:
            raise ValueError(f"Invalid null filter operator: {op}")

    @classmethod
    def handle_comparison_filter(
        cls, sqla_col: Any, op: utils.FilterOperator, value: Any
    ) -> BinaryExpression:
        """
        Handle comparison filter operations (=, !=, >, <, >=, <=).

        :param sqla_col: SQLAlchemy column element
        :param op: Filter operator
        :param value: Filter value
        :return: SQLAlchemy expression for the comparison filter
        """
        from superset.utils import core as utils

        if op == utils.FilterOperator.EQUALS:
            return sqla_col == value
        elif op == utils.FilterOperator.NOT_EQUALS:
            return sqla_col != value
        elif op == utils.FilterOperator.GREATER_THAN:
            return sqla_col > value
        elif op == utils.FilterOperator.LESS_THAN:
            return sqla_col < value
        elif op == utils.FilterOperator.GREATER_THAN_OR_EQUALS:
            return sqla_col >= value