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 if a constant appears where a field reference is expected #5274

Open
philrz opened this issue Sep 12, 2024 · 0 comments
Open

Warn if a constant appears where a field reference is expected #5274

philrz opened this issue Sep 12, 2024 · 0 comments

Comments

@philrz
Copy link
Contributor

philrz commented Sep 12, 2024

tl;dr

A community user attempted sort 'Source Zone','Destination Zone' thinking this was the right way to specify field names that contained spaces. Their sort had no effect and the tooling provided no warning or error, but perhaps it could have.

Details

At the time this issue is being filed, Zed is at commit 21b7168.

The user's original screenshot from a community Slack thread:

image

Ideally they'd have read the field dereference docs or used Zui's right-click sorting shortcuts and hence known to instead write sort this['Source Zone'],this['Destination Zone']. However, knowing that users often don't read the docs, I was left wondering if the tooling could have delivered some kind of feedback to help point them in the right direction.

In a group discussion, @mccanne pointed out that in the user's query 'Source Zone' and 'Destination Zone' are constants, so since sort expects references to field names or expressions that reference field names, it would be technically possible for the tools to recognize that only plain constants were provided and inform the user that this is probably not what they intended. This would hopefully inspire them to check the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant