From 84c00083d6bf2f4dbcbf2e1ff44727d721cb79ad Mon Sep 17 00:00:00 2001 From: eitsupi <50911393+eitsupi@users.noreply.github.com> Date: Wed, 26 Jul 2023 08:48:05 +0900 Subject: [PATCH] feat!: based on the released version of prql-compiler 0.9.2 (#145) Close #49 --- LICENSE.note | 64 ++++------ NEWS.md | 2 +- README.md | 8 +- src/rust/Cargo.lock | 174 +++++++++++++------------- src/rust/Cargo.toml | 3 +- tests/testthat/_snaps/compile.md | 4 +- tests/testthat/_snaps/knitr-engine.md | 4 +- tests/testthat/test-compile.R | 2 +- 8 files changed, 121 insertions(+), 140 deletions(-) diff --git a/LICENSE.note b/LICENSE.note index ae98c079..035acb54 100644 --- a/LICENSE.note +++ b/LICENSE.note @@ -143,13 +143,6 @@ License: Apache-2.0 OR MIT ------------------------------------------------------------- -Name: equivalent -Repository: https://github.com/cuviper/equivalent -Authors: equivalent authors -License: Apache-2.0 OR MIT - -------------------------------------------------------------- - Name: errno Repository: https://github.com/lambda-fairy/rust-errno Authors: Chris Wong @@ -206,13 +199,6 @@ License: Apache-2.0 OR MIT ------------------------------------------------------------- -Name: hashbrown -Repository: https://github.com/rust-lang/hashbrown -Authors: Amanieu d'Antras -License: Apache-2.0 OR MIT - -------------------------------------------------------------- - Name: heck Repository: https://github.com/withoutboats/heck Authors: Without Boats @@ -227,13 +213,6 @@ License: Apache-2.0 OR MIT ------------------------------------------------------------- -Name: indexmap -Repository: https://github.com/bluss/indexmap -Authors: indexmap authors -License: Apache-2.0 OR MIT - -------------------------------------------------------------- - Name: is-terminal Repository: https://github.com/sunfishcode/is-terminal Authors: softprops, Dan Gohman @@ -353,6 +332,13 @@ License: Apache-2.0 OR MIT ------------------------------------------------------------- +Name: prql-ast +Repository: https://github.com/PRQL/prql +Authors: prql-ast authors +License: Apache-2.0 + +------------------------------------------------------------- + Name: prql-compiler Repository: https://github.com/PRQL/prql Authors: prql-compiler authors @@ -360,6 +346,13 @@ License: Apache-2.0 ------------------------------------------------------------- +Name: prql-parser +Repository: https://github.com/PRQL/prql +Authors: prql-parser authors +License: Apache-2.0 + +------------------------------------------------------------- + Name: psm Repository: https://github.com/rust-lang/stacker/ Authors: Simonas Kazlauskas @@ -376,14 +369,21 @@ License: Apache-2.0 OR MIT Name: regex Repository: https://github.com/rust-lang/regex -Authors: The Rust Project Developers +Authors: The Rust Project Developers, Andrew Gallant +License: Apache-2.0 OR MIT + +------------------------------------------------------------- + +Name: regex-automata +Repository: https://github.com/rust-lang/regex/tree/master/regex-automata +Authors: The Rust Project Developers, Andrew Gallant License: Apache-2.0 OR MIT ------------------------------------------------------------- Name: regex-syntax -Repository: https://github.com/rust-lang/regex -Authors: The Rust Project Developers +Repository: https://github.com/rust-lang/regex/tree/master/regex-syntax +Authors: The Rust Project Developers, Andrew Gallant License: Apache-2.0 OR MIT ------------------------------------------------------------- @@ -432,7 +432,7 @@ License: Apache-2.0 OR MIT Name: serde_derive Repository: https://github.com/serde-rs/serde -Authors: Erick Tryzelaar, David Tolnay +Authors: David Tolnay License: Apache-2.0 OR MIT ------------------------------------------------------------- @@ -444,13 +444,6 @@ License: Apache-2.0 OR MIT ------------------------------------------------------------- -Name: serde_yaml -Repository: https://github.com/dtolnay/serde-yaml -Authors: David Tolnay -License: Apache-2.0 OR MIT - -------------------------------------------------------------- - Name: sqlformat Repository: https://github.com/shssoichiro/sqlformat-rs Authors: Josh Holmer @@ -521,13 +514,6 @@ License: Apache-2.0 OR MIT ------------------------------------------------------------- -Name: unsafe-libyaml -Repository: https://github.com/dtolnay/unsafe-libyaml -Authors: David Tolnay -License: MIT - -------------------------------------------------------------- - Name: utf8parse Repository: https://github.com/alacritty/vte Authors: Joe Wilm, Christian Duerr diff --git a/NEWS.md b/NEWS.md index 9d146348..a2dfa728 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,7 +2,7 @@ ## Breaking changes -- Based on [`prql-compiler`](https://github.com/prql/prql) 0.9.0 (#130, #137, #142) +- Based on [`prql-compiler`](https://github.com/prql/prql) 0.9.2 (#130, #137, #142, #145) ## Bug fixes diff --git a/README.md b/README.md index 597d5ea4..0cfe055c 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ R bindings for [the `prql-compiler` Rust library](https://github.com/prql/prql), powered by [the `extendr` framework](https://extendr.github.io/). -This version supports PRQL 0.8.1. +This version supports PRQL 0.9.2. ## Installation @@ -54,7 +54,7 @@ library(prqlr) #> WHERE #> cyl > 6 #> -#> -- Generated by PRQL compiler version:0.8.1 (https://prql-lang.org) +#> -- Generated by PRQL compiler version:0.9.2 (https://prql-lang.org) ``` PRQL’s pipelines can be joined by the newline character (`\n`), or @@ -72,7 +72,7 @@ actual newlines in addition to `|`. #> WHERE #> cyl > 6 #> -#> -- Generated by PRQL compiler version:0.8.1 (https://prql-lang.org) +#> -- Generated by PRQL compiler version:0.9.2 (https://prql-lang.org) ``` ``` r @@ -89,7 +89,7 @@ select {cyl, mpg}" |> #> WHERE #> cyl > 6 #> -#> -- Generated by PRQL compiler version:0.8.1 (https://prql-lang.org) +#> -- Generated by PRQL compiler version:0.9.2 (https://prql-lang.org) ``` Thanks to the `{tidyquery}` package, we can even convert a PRQL query to diff --git a/src/rust/Cargo.lock b/src/rust/Cargo.lock index 762f7b6e..4fc22e2d 100644 --- a/src/rust/Cargo.lock +++ b/src/rust/Cargo.lock @@ -88,9 +88,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" dependencies = [ "backtrace", ] @@ -144,7 +144,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23170228b96236b5a7299057ac284a321457700bc8c41a4476052f0f4ba5349d" dependencies = [ - "hashbrown 0.12.3", + "hashbrown", "stacker", ] @@ -177,9 +177,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "enum-as-inner" @@ -190,15 +190,9 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] -[[package]] -name = "equivalent" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1" - [[package]] name = "errno" version = "0.3.1" @@ -279,12 +273,6 @@ dependencies = [ "ahash", ] -[[package]] -name = "hashbrown" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" - [[package]] name = "heck" version = "0.4.1" @@ -293,25 +281,15 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" - -[[package]] -name = "indexmap" -version = "2.0.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" -dependencies = [ - "equivalent", - "hashbrown 0.14.0", -] +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] name = "is-terminal" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24fddda5af7e54bf7da53067d6e802dbcc381d0a8eef629df528e3ebf68755cb" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi", "rustix", @@ -338,9 +316,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "lazy_static" @@ -420,44 +398,69 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "paste" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b27ab7be369122c218afc2079489cdcb4b517c0a3fc386ff11e1fedfcc2b35" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "proc-macro2" -version = "1.0.63" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] +[[package]] +name = "prql-ast" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdeec2a65ab31ec207e6b417a5c369da1d6625c181c4118f02f26410dbf823f3" +dependencies = [ + "enum-as-inner", + "semver", + "serde", + "strum", +] + [[package]] name = "prql-compiler" -version = "0.8.1" -source = "git+https://github.com/PRQL/prql?rev=9121296bb059ebf256fa61d6b6d11664bf971824#9121296bb059ebf256fa61d6b6d11664bf971824" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed8afd1242b9d4bf5a544edc24f8d49aaf71052b4f1f799de81a977b795620ed" dependencies = [ "anstream", "anyhow", "ariadne", - "chumsky", "csv", "enum-as-inner", "itertools 0.11.0", "log", "once_cell", + "prql-ast", + "prql-parser", "regex", "semver", "serde", "serde_json", - "serde_yaml", "sqlformat", "sqlparser", "strum", "strum_macros", ] +[[package]] +name = "prql-parser" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bce7d986ef30a953fe266ead24224231e988a7c6310be109af620072842dfc5c" +dependencies = [ + "chumsky", + "itertools 0.11.0", + "prql-ast", + "semver", +] + [[package]] name = "prqlr" version = "0.1.0" @@ -478,18 +481,30 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.29" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" dependencies = [ "proc-macro2", ] [[package]] name = "regex" -version = "1.8.4" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" +checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" dependencies = [ "aho-corasick", "memchr", @@ -498,9 +513,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" +checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" [[package]] name = "rustc-demangle" @@ -510,9 +525,9 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustix" -version = "0.38.2" +version = "0.38.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aabcb0461ebd01d6b79945797c27f8529082226cb630a9865a71870ff63532a4" +checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" dependencies = [ "bitflags", "errno", @@ -523,67 +538,54 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc31bd9b61a32c31f9650d18add92aa83a49ba979c143eefd27fe7177b05bd5f" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "semver" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.166" +version = "1.0.175" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d01b7404f9d441d3ad40e6a636a7782c377d2abdbe4fa2440e2edcc2f4f10db8" +checksum = "5d25439cd7397d044e2748a6fe2432b5e85db703d6d097bd014b3c0ad1ebff0b" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.166" +version = "1.0.175" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dd83d6dde2b6b2d466e14d9d1acce8816dedee94f735eac6395808b3483c6d6" +checksum = "b23f7ade6f110613c0d63858ddb8b94c1041f550eab58a16b371bdf2c9c80ab4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] name = "serde_json" -version = "1.0.99" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46266871c240a00b8f503b877622fe33430b3c7d963bdc0f2adc511e54a1eae3" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_yaml" -version = "0.9.22" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "452e67b9c20c37fa79df53201dc03839651086ed9bbe92b3ca585ca9fdaa7d85" +checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" dependencies = [ - "indexmap", "itoa", "ryu", "serde", - "unsafe-libyaml", ] [[package]] @@ -599,9 +601,9 @@ dependencies = [ [[package]] name = "sqlparser" -version = "0.35.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca597d77c98894be1f965f2e4e2d2a61575d4998088e655476c73715c54b2b43" +checksum = "2eaa1e88e78d2c2460d78b7dc3f0c08dbb606ab4222f9aff36f420d36e307d87" dependencies = [ "log", "serde", @@ -639,7 +641,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -655,9 +657,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.23" +version = "2.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737" +checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0" dependencies = [ "proc-macro2", "quote", @@ -666,9 +668,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unicode-width" @@ -682,12 +684,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" -[[package]] -name = "unsafe-libyaml" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1865806a559042e51ab5414598446a5871b561d21b6764f2eabb0dd481d880a6" - [[package]] name = "utf8parse" version = "0.2.1" diff --git a/src/rust/Cargo.toml b/src/rust/Cargo.toml index e319f6b8..e55600a0 100644 --- a/src/rust/Cargo.toml +++ b/src/rust/Cargo.toml @@ -10,6 +10,5 @@ name = "prqlr" [dependencies] extendr-api = "0.4.0" -# prql-compiler = { version = "0.9.0", default-features = false } -prql-compiler = { git = "https://github.com/PRQL/prql", rev = "9121296bb059ebf256fa61d6b6d11664bf971824", default-features = false } +prql-compiler = { version = "0.9.2", default-features = false } anstream = { version = "0.3.2", features = ["auto"] } diff --git a/tests/testthat/_snaps/compile.md b/tests/testthat/_snaps/compile.md index e302d6af..14bd8ca6 100644 --- a/tests/testthat/_snaps/compile.md +++ b/tests/testthat/_snaps/compile.md @@ -8,7 +8,7 @@ FROM a - -- Generated by PRQL compiler version:0.8.1 (https://prql-lang.org) + -- Generated by PRQL compiler version:0.9.2 (https://prql-lang.org) --- @@ -29,7 +29,7 @@ FROM star_wars - -- Generated by PRQL compiler version:0.8.1 target:sql.duckdb (https://prql-lang.org) + -- Generated by PRQL compiler version:0.9.2 target:sql.duckdb (https://prql-lang.org) # Syntax error query=Mississippi has four S’s and four I’s. diff --git a/tests/testthat/_snaps/knitr-engine.md b/tests/testthat/_snaps/knitr-engine.md index c8e31e01..0926bf61 100644 --- a/tests/testthat/_snaps/knitr-engine.md +++ b/tests/testthat/_snaps/knitr-engine.md @@ -183,7 +183,7 @@ LIMIT 3 - -- Generated by PRQL compiler version:0.8.1 (https://prql-lang.org) + -- Generated by PRQL compiler version:0.9.2 (https://prql-lang.org) ``` @@ -235,7 +235,7 @@ LIMIT 3 - -- Generated by PRQL compiler version:0.8.1 (https://prql-lang.org) + -- Generated by PRQL compiler version:0.9.2 (https://prql-lang.org) ``` --- diff --git a/tests/testthat/test-compile.R b/tests/testthat/test-compile.R index 60f90f97..d7c3ef52 100644 --- a/tests/testthat/test-compile.R +++ b/tests/testthat/test-compile.R @@ -90,5 +90,5 @@ take 2 ) test_that("prql-compiler's version", { - expect_equal(prql_version(), numeric_version("0.8.1")) + expect_equal(prql_version(), numeric_version("0.9.2")) })