Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn when selection only includes static data #7758

Merged
merged 3 commits into from
Oct 16, 2024
Merged

Conversation

jleibs
Copy link
Member

@jleibs jleibs commented Oct 15, 2024

What

Based on top of:

This 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:

  • Writes a content expression that only matches static content
  • AND writes a select statement that queries static data
  • AND does not call 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

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!
  • If have noted any breaking changes to the log API in CHANGELOG.md and the migration guide

To run all checks from main, comment on the PR with @rerun-bot full-check.

@jleibs jleibs added 🐍 Python API Python logging API do-not-merge Do not merge this PR exclude from changelog PRs with this won't show up in CHANGELOG.md feat-dataframe-api Everything related to the dataframe API labels Oct 15, 2024
@jleibs jleibs marked this pull request as ready for review October 15, 2024 21:52
Base automatically changed from jleibs/view_schema to main October 16, 2024 07:40
@teh-cmc teh-cmc force-pushed the jleibs/warn_static_empty branch from 619a5a1 to 19b2f95 Compare October 16, 2024 08:02
@teh-cmc teh-cmc removed the do-not-merge Do not merge this PR label Oct 16, 2024
@teh-cmc teh-cmc merged commit 520917e into main Oct 16, 2024
33 of 35 checks passed
@teh-cmc teh-cmc deleted the jleibs/warn_static_empty branch October 16, 2024 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude from changelog PRs with this won't show up in CHANGELOG.md feat-dataframe-api Everything related to the dataframe API 🐍 Python API Python logging API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants