Repository navigation
Conversation
…at random When prqlc compile is given a directory with several root-level files starting with an uppercase letter, the root module was the first match in HashMap iteration order, so repeated runs compiled different files. Report the candidates instead. Also only consider files directly in the root directory, so a file inside an uppercase directory isn't taken as the root.
for more information, see https://pre-commit.ci
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
prqlc compile <dir>picked the root module at random when more than one file in the directory starts with an uppercase letter.linearize_treetook the first such key of the source tree'sHashMap, so withProject.prql(from a) andOther.prql(from b), six runs onmain(0d4c6efe) printedSELECT * FROM btwice andSELECT * FROM afour times. This PR reports both candidates as anE0002error instead:The same check only looked at a path's first component, which is the directory name for a nested file. So
Foo/bar.prqlcounted as an uppercase root, andSales/orders.prqlcompeted withProject.prqlin the random pick. Now only files directly in the root directory count, which matches what the book's modules page says. I've tightened that page's sentence to say there must be exactly one such file.A single file, or a tree with an empty-path root, is resolved as before.
linearize_treehad no tests. The three new unit tests inparser.rscover one uppercase root next to an uppercase directory, two uppercase roots, and an uppercase directory with no root file. With the old check all three fail.cargo insta test -p prqlc --lib --test integrationpasses, including the CLI test that compilestests/integration/project.Found by the nightly code survey.