File size: 456 Bytes
b67668b | 1 2 3 4 5 6 7 8 9 10 11 12 | import pandas as pd
from src.core.query import QuerySpec, FilterSpec, execute_query
def test_execute_query_eq():
df = pd.DataFrame([
{"Name":"A", "Department":"Artificial Intelligence"},
{"Name":"B", "Department":"Data Science"},
])
spec = QuerySpec(select=["Name"], filters=[FilterSpec(column="Department", op="eq", value="Artificial Intelligence")])
out = execute_query(spec, df)
assert out["Name"].tolist() == ["A"]
|