ExpectColumnValuesToBeInSet with null in value_set gives opposite verdicts on pandas vs sql engines

Author: ptimizeroracleCreated Sep 26, 2026Updated Sep 26, 2026

same data, same expectation, opposite results depending on the execution engine, this time for ExpectColumnValuesToBeInSet when the value_set contains None

python
import sqlite3, pandas as pd
import great_expectations as gx
import great_expectations.expectations as gxe

df = pd.DataFrame({"s": ["a", "b", None, "a"]})
conn = sqlite3.connect("/tmp/gx.db"); df.to_sql("t", conn, index=False); conn.commit(); conn.close()

ctx = gx.get_context(mode="ephemeral")
bp = ctx.data_sources.add_pandas(name="p").add_dataframe_asset(name="a").add_batch_definition_whole_dataframe("w").get_batch(batch_parameters={"dataframe": df})
bs = ctx.data_sources.add_sqlite(name="s", connection_string="sqlite:////tmp/gx.db").add_table_asset(name="a2", table_name="t").add_batch_definition_whole_table("w").get_batch()

exp = gxe.ExpectColumnValuesToBeInSet(column="s", value_set=["a", None])
print(bp.validate(exp).success)   # False, unexpected_count=1
print(bs.validate(exp).success)   # True, unexpected_count=0
  • pandas: the null row is counted as unexpected, isin(["a", None]) does not match it, so the expectation fails
  • sqlite: the null row is treated as in the set, unexpected_count=0, the expectation passes

so whether None in a value_set means "nulls are allowed" or "nulls fail" depends on which engine runs the same suite. with mostly thresholds in between, a data-quality gate can silently flip from pass to fail by moving a suite between engines

same class of engine-dependent verdicts as #12264 (pair expectations with single-null pairs) and #12263 (expectations silently unsupported on sql)

happy to look into a fix if there is agreement on the target semantics, my instinct would be treating None in value_set as intentional "null is allowed" everywhere since that is what a user writing value_set=[..., None] is asking for, but the pandas side ignoring it may be intended

Source: fivetran/great_expectations