Warn when selection only includes static data #7758
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Based on top of:
view.schema()
API and improved support for static data #7754This tries to alleviates a possible footgun where a user creates what appears to be a valid view expression but it only includes static data. In these cases the results of
.select()
won't produce any data since there are no row-providing columns.There are many possible ways to end up in this state but the logic here should not be too likely for false-warnings while producing a reasonable degree of user safety.
If the user:
using_index_values(...)
Then we will produce a warning.
The most likely false positive where this would introduce a spurious warning would be a user wanting to query for a mixture of static and non-static data in a circumstance where sometimes none of the non-static data is logged and the user expects to (correctly) get no rows in this case. However, these circumstances generally imply a more advanced user that could then work around then with a mixed query + join anyways.
Future work:
Checklist
main
build: rerun.io/viewernightly
build: rerun.io/viewerCHANGELOG.md
and the migration guideTo run all checks from
main
, comment on the PR with@rerun-bot full-check
.