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

[Bug]: query casing is not respected for file queries and aliases #2918

Open
kennan-simpliphy opened this issue Dec 16, 2024 · 1 comment
Open
Labels
bug Something isn't working customer request An Evidence customer has requested this to-review Evidence team to review

Comments

@kennan-simpliphy
Copy link

kennan-simpliphy commented Dec 16, 2024

Describe the bug

---
queries:
  - releaseYear: release_year.sql
---

vs

---
queries:
  - my_alternative_alias: release_year.sql
---

If you alias release_year.sql as releaseYear, the frontmatter will run without error and a query named releaseyear (lowercase 'y') will run successfully. But there will not be a query named releaseYear (capital 'y') in the scope, and any downstream attempts to reference it as such will fail.

While the examples in the docs use snakecase, I don't believe anywhere in the docs indicates that camelCase aliases will cause this particular bug.

Severity

annoyance

Additional Information, or Workarounds

No response

@kennan-simpliphy kennan-simpliphy added bug Something isn't working to-review Evidence team to review labels Dec 16, 2024
@archiewood archiewood added the customer request An Evidence customer has requested this label Dec 17, 2024
@archiewood
Copy link
Member

archiewood commented Dec 17, 2024

I've looked back into the PR where this feature was implemented.

#734

We intentionally decided to lowercase all query ids because of unexpected behaviour if you used mixed cases. Solution is therefore

  1. Better docs - document this behaviour
  2. And ideally - throw useful warning if user tries to use capital letters in a query ID

or better yet

  1. Fix this behaviour

@archiewood archiewood changed the title [Bug]: camelCase alias for frontmatter file queries are undefined [Bug]: query casing is not respected for file queries and aliases Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working customer request An Evidence customer has requested this to-review Evidence team to review
Projects
None yet
Development

No branches or pull requests

2 participants