Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions tests/test_result_set_facets.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,18 @@ def test_facets_first_give_the_same_facets(self, test_db):
assert rs.facets == facets
rows_first = test_db.query("sql", TERMS_Q)
rows_first.to_list()
# meta is how far the projection lagged, which can differ between two runs
assert {k: v for k, v in facets.items() if k != "meta"} == {
k: v for k, v in rows_first.facets.items() if k != "meta"
}

# meta is how far the projection lagged, which can differ between two runs, and so can the source of a facet: `index` once the
# projection has caught up, `scan` before (both are correct answers, see "source" in the facets guide), so the two runs are
# compared on what they count (#461)
def counted(result):
return {
k: {name: value for name, value in facet.items() if name != "source"}
for k, facet in result.items()
if k != "meta"
}

assert counted(facets) == counted(rows_first.facets)

def test_facets_of_a_lazy_command_cursor(self, test_db):
_docs(test_db)
Expand Down
Loading