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

Code before:
        use_equality_for_boolean_filters to use equality operators instead.

        :param sqla_col: SQLAlchemy column element
        :param op: Filter operator (IS_TRUE or IS_FALSE)
        :param value: Boolean value (True or False)
        :return: SQLAlchemy expression for the boolean filter
        """
        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:

Review comment (suggestion):
Then adjust accordingly:

```suggestion
        if op == utils.FilterOperator.IS_NULL:
            return sqla_col.is_(None)
        elif op == utils.FilterOperator.IS_NOT_NULL:
```

Code after:
        use_equality_for_boolean_filters to use equality operators instead.

        :param sqla_col: SQLAlchemy column element
        :param op: Filter operator (IS_TRUE or IS_FALSE)
        :param value: Boolean value (True or False)
        :return: SQLAlchemy expression for the boolean filter
        """
        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: