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

glob! on Windows doesn't seem to include input_file #336

Closed
max-sixty opened this issue Jan 7, 2023 · 4 comments · Fixed by #371 or #386
Closed

glob! on Windows doesn't seem to include input_file #336

max-sixty opened this issue Jan 7, 2023 · 4 comments · Fixed by #371 or #386
Labels
bug Something isn't working

Comments

@max-sixty
Copy link
Sponsor Contributor

What happened?

Thanks for the recent changes in 1.26! I've updated PRQL with the latest changes, they're great.

The last thing I'm having trouble with is forcing updates — Windows seems to produce different metadata, which causes its tests to fail. Specifically, Windows doesn't seem to show input_file in glob! tests. Even if we skipped those tests, anyone contributing on Windows would be submitting PRs with huge diffs.

I looked around the insta code, but couldn't find why that might happen (looks like there isn't much platform-specific code in insta, so it's a puzzle, and unfortunately I don't have a Windows machine, so it's difficult to debug).

Here's an example: https://github.com/PRQL/prql/actions/runs/3861652619/jobs/6582754606#step:3:2726. (Note I made the tests pass there to see the diff, but otherwise it fails; e.g. here)

Any thoughts on why that might be happening? If not I can look more.

Reproduction steps

No response

Insta Version

1.26

rustc Version

rustc 1.65.0 (897e37553 2022-11-02)

What did you expect?

No response

@max-sixty max-sixty added the bug Something isn't working label Jan 7, 2023
@mitsuhiko
Copy link
Owner

I’m also confused why it writes .new files. Seems like it does not manage to detect the CI environment.

@mitsuhiko
Copy link
Owner

Unfortunately I am not sure what is happening here.

@max-sixty
Copy link
Sponsor Contributor Author

I just took another look.

One of the issues is the line-endings:

-expression: "table newest_employees = (\n  from employees\n  sort tenure\n  take 50\n)\n\ntable average_salaries = (\n  from salaries\n  group country (\n    aggregate average_country_salary = (average salary)\n  )\n)\n\nfrom newest_employees\njoin average_salaries [==country]\nselect [name, salary, average_country_salary]\n"
-input_file: book/tests/prql/examples/cte-0.prql
+expression: "table newest_employees = (\r\n  from employees\r\n  sort tenure\r\n  take 50\r\n)\r\n\r\ntable average_salaries = (\r\n  from salaries\r\n  group country (\r\n    aggregate average_country_salary = (average salary)\r\n  )\r\n)\r\n\r\nfrom newest_employees\r\njoin average_salaries [==country]\r\nselect [name, salary, average_country_salary]\r\n"

But then the really confusing part is leaving out the input_file line:

diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__window-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__window-1.prql.snap
index afffeb8..c0eb1a5 100644
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__window-1.prql.snap
+++ b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__window-1.prql.snap
@@ -1,7 +1,6 @@
 ---
 source: book/tests/snapshot.rs
 expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/window-1.prql
 ---
 from orders
 sort day

Possibly someone with a windows machine would be well placed to debug...

@mitsuhiko
Copy link
Owner

The windows newlines are addressed by 48f044e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants