Uh oh!
There was an error while loading. Please reload this page.
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| first_result.0, | ||
| k | ||
| ); | ||
| } |
There was a problem hiding this comment.
Your implementation is probably better at debugging, so feel completely free to keep it.
That said, I think it's possible to simplify it a bit — here's one approach. The result is basically the same (the only difference is that the snapshot file contains the input prql as the expression, because of the third item passed to assert_snapshot!)
#[test]fntest_rdbms(){let runtime = Runtime::new().unwrap();letmut connections = get_connections(&runtime);for con in&mut connections {setup_connection(con.as_mut(),&runtime);}// for each of the queriesglob!("queries/**/*.prql", |path| {// readlet prql = fs::read_to_string(path).unwrap();if prql.contains("skip_test"){return;}for con in &mut connections {let vendor = con.get_dialect().to_string().to_lowercase();if prql.contains(format!("skip_{}", vendor).as_str()){continue;}let result = run_query(con.as_mut(), prql.as_str(),&runtime);let result_string = result.iter().map(|row| row.join(",")).join("\n");
assert_snapshot!("rdbms".to_string(),&result_string,&prql);}});}(hopefully this is helpful feedback, rather than dispiriting that someone is "rewriting your code", let me know either way)
Uh oh!
There was an error while loading. Please reload this page.
| expression: result_string | ||
| input_file: prql-compiler/tests/integration/queries/invoice_totals.prql | ||
| --- | ||
| 2009-01,2009-01-01,1,2,1.98,2, |
There was a problem hiding this comment.
Not on you at all, and def not necessary in this PR, but one thing we could do is adjust the queries so they produce more aggregated results — we probably get the same test coverage with more legible outputs...
There was a problem hiding this comment.
Sure.
And we have to remove the skips for certain dbs. Especially MsSQL is hardly tested.
Co-authored-by: Maximilian Roos <5635139+max-sixty@users.noreply.github.com>
max-sixty
commented
Apr 2, 2023
Looking great! We can merge whenever you're ready! |
Jelenkee
commented
Apr 3, 2023
@max-sixty Docs have been added. You may have a look at it. If everything is fine, you can merge |
for more information, see https://pre-commit.ci
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: eitsupi <50911393+eitsupi@users.noreply.github.com>
max-sixty
commented
Apr 3, 2023
Great — am promoting it from Draft and will merge! |
max-sixty
commented
Apr 3, 2023
Thanks @Jelenkee ! Is there anything else remaining on the infra? I think it's in a very good state. If you thought #2362 (comment) was valid, fine to make that change. We could also start thinking about the current exclusions — was there anything you saw that's a PRQL bug (more than just the DB doesn't support it — in which case maybe we could improve the error messages but can't make it work...)? |
#2353