Comments (7)
It's also freeze.
"from a | select {b}" |> prqlr:::compile(target = NULL, format = FALSE, signature_comment = FALSE)
prqlc's output:
$ echo 'from a | select {b}' | prqlc compile
Error:
╭─[-:1:17]
│
1 │ from a | select {b}
· ┬
· ╰── unexpected {
───╯
Error:
╭─[-:1:19]
│
1 │ from a | select {b}
· ┬
· ╰── unexpected }
───╯
from prqlc-r.
Ok(prql_query).and_then(prql_compiler::prql_to_pl)
seems to be the cause, because it does not hang up when changed as follows.
diff --git a/src/rust/src/lib.rs b/src/rust/src/lib.rs
index 157c441..e762d28 100644
--- a/src/rust/src/lib.rs
+++ b/src/rust/src/lib.rs
@@ -17,7 +17,7 @@ pub fn compile(
target: Option<String>,
format: bool,
signature_comment: bool,
-) -> List {
+) -> String {
let options = convert_options(CompileOptions {
format,
target: target.unwrap_or("sql.any".to_string()),
@@ -27,13 +27,12 @@ pub fn compile(
let result = options
.and_then(|opts| {
Ok(prql_query)
- .and_then(prql_compiler::prql_to_pl)
- .and_then(prql_compiler::pl_to_rq)
- .and_then(|rq| prql_compiler::rq_to_sql(rq, &opts))
- })
- .map_err(|e| e.composed("", prql_query, false));
+ // .and_then(prql_compiler::prql_to_pl)
+ // .and_then(prql_compiler::pl_to_rq)
+ // .and_then(|rq| prql_compiler::rq_to_sql(rq, &opts))
+ });
- r_result_list(result)
+ "out".to_string()
}
struct CompileOptions {
prql_to_pr
also freezes.
"from a | select {b}" |> prqlr:::prql_to_pl()
from prqlc-r.
After all, the cause seems to be prql_compiler::prql_to_pl
.
"from a | select {b}" |> prqlr:::prql_to_pl()
hangs even if the following changes are made.
diff --git a/src/rust/src/lib.rs b/src/rust/src/lib.rs
index 157c441..3341f67 100644
--- a/src/rust/src/lib.rs
+++ b/src/rust/src/lib.rs
@@ -57,12 +57,10 @@ fn convert_options(
/// @noRd
#[extendr]
-pub fn prql_to_pl(prql_query: &str) -> List {
- let result = Ok(prql_query)
- .and_then(prql_compiler::prql_to_pl)
- .and_then(prql_compiler::json::from_pl);
+pub fn prql_to_pl(prql_query: &str) -> String {
+ let result = prql_compiler::prql_to_pl(prql_query);
- r_result_list(result)
+ "out".to_string()
}
/// @noRd
from prqlc-r.
I thought it might be the length of the error message, but the following longer error message seems to work.......
> longstring <- rep(letters,1E4) |> paste0(collapse = "")
> longstring |> stringr::str_length()
[1] 260000
> prqlr:::compile("from a", target = longstring, format = FALSE, signature_comment = FALSE)
# works and shows a long error message
> prqlr:::compile(longstring, target = NULL, format = FALSE, signature_comment = FALSE)
# also works and shows a long error message
from prqlc-r.
prql-python via reticulate done not have a problem.
> prql <- reticulate::import("prql_python")
> prql$compile("from a | select {b}")
Error: SyntaxError: Error:
╭─[:1:17]
│
1 │ from a | select {b}
· ┬
· ╰── unexpected {
───╯
Error:
╭─[:1:19]
│
1 │ from a | select {b}
· ┬
· ╰── unexpected }
───╯
from prqlc-r.
When I check with htop, the process seems to keep running...
from prqlc-r.
In prqlc, "from a | select {{b"
and "from a | select {{{b"
cause the same error, but prqlr freezes only in the latter case!
> "from a | select {{b" |> prqlr:::prql_to_pl() |> prqlr:::unwrap()
Error in prqlr:::unwrap(prqlr:::prql_to_pl("from a | select {{b")) :
Error:
╭─[:1:17]
│
1 │ from a | select {{b
· ┬
· ╰── unexpected {
───╯
> "from a | select {{{b" |> prqlr:::prql_to_pl() |> prqlr:::unwrap()
# freeze
$ echo 'from a | select {{b' | prqlc compile
Error:
╭─[-:1:17]
│
1 │ from a | select {{b
· ┬
· ╰── unexpected {
───╯
$ echo 'from a | select {{{b' | prqlc compile
Error:
╭─[-:1:17]
│
1 │ from a | select {{{b
· ┬
· ╰── unexpected {
───╯
from prqlc-r.
Related Issues (20)
- Fix compile error on Windows with Rust 1.70
- color code handlling in errors
- Update for "Using Rust in CRAN packages" HOT 2
- Docs about vendoring HOT 1
- Package ‘prqlr’ was removed from the CRAN repository. Archived on 2023-08-19 for policy violation. HOT 1
- Package ‘prqlr’ was removed from the CRAN repository. Archived on 2023-08-31 for policy violation. HOT 3
- CRAN acceptable inst/AUTHORS format HOT 2
- Updates for knitr 1.44
- Installation issue on Windows HOT 1
- CI: cache Rust
- CI: upload binary artifacts
- Rust lib binary release
- manual entry for prqlr HOT 1
- pre-built binaries shoud be built with R 4.2? HOT 1
- Support arm64 cross-compile on R-universe
- Rename the package and transfar the repo HOT 9
- Follow up tasks for #252
- build fails on nightly (or wasm target only?) HOT 2
- Build failuar on CRAN Windows builder HOT 4
- WASM build check in CI
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prqlc-r.