Skip to content

Fix the benchmark-queries crash for ASK queries with --result-file - #360

Merged
hannahbast merged 3 commits into
mainfrom
fix-benchmark-ask
Oct 27, 2026
Merged

hannahbast merged 3 commits into
mainfrom
fix-benchmark-ask

Conversation

@hannahbast

@hannahbast hannahbast commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

So far, qlever benchmark-queries crashed with TypeError: 'NoneType' object is not iterable for an ASK query when the result format was application/sparql-results+json and a result file was requested with --result-file. The reason is that the result of an ASK query has no bindings, but a single boolean. The size of an ASK result was also reported as 0, in both JSON formats.

This change reports the result of an ASK query with size 1 and writes the boolean to the result file. In particular, fixes ad-freiburg/qlever#3837.

The result of an ASK query in `application/sparql-results+json` has no
bindings but a single boolean. Report it with size 1 and write the boolean
to the result file, instead of crashing with "'NoneType' object is not
iterable" and reporting size 0.
Copilot AI balanced review requested due to automatic review settings October 27, 2026 23:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

…son`

QLever reports a `resultsize` of 0 for an ASK query, with the boolean in
`res`. Use the same ASK criterion for the size and the results of
`application/sparql-results+json`, and treat missing bindings as empty.
One test covers the ASK result in both JSON formats. The SELECT block is
dropped, the existing tests cover that path.
@hannahbast
hannahbast merged commit 15208dc into main Oct 27, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

benchmark-queries crashes when processing ASK query

2 participants