Skip to content

Commit

Permalink
Merge origin/main into remove-any
Browse files Browse the repository at this point in the history
  • Loading branch information
aljazerzen committed Jan 27, 2025
2 parents 874a5ca + 6b49ff1 commit 5becae5
Show file tree
Hide file tree
Showing 35 changed files with 992 additions and 185 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ repos:
hooks:
- id: actionlint
- repo: https://github.com/tcort/markdown-link-check
rev: v3.13.6
rev: v3.12.2
hooks:
- id: markdown-link-check
name: markdown-link-check-local
Expand Down
17 changes: 14 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

**Fixes**:

- Sort steps in sub-pipelines no longer cause a column lookup error
(@lukapeschke, #5066)

**Documentation**:

**Web**:
Expand All @@ -21,6 +18,20 @@

**New Contributors**:

## 0.13.3 — 2025-01-25

0.13.3 is a small release containing a few bug fixes and improvements. It has 86
commits from 10 contributors. Selected changes:

**Fixes**:

- Sort steps in sub-pipelines no longer cause a column lookup error
(@lukapeschke, #5066)
- Dereferencing of sort columns when rendering SQL now done in context of main
pipeline (@kgutwin, #5098)

**New Contributors**:

- @lukapeschke, with #5066

## 0.13.2
Expand Down
32 changes: 16 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repository = "https://github.com/PRQL/prql"
# This isn't tested since `cargo-msrv` doesn't support workspaces; instead we
# test `metadata.msrv` in `prqlc`
rust-version = "1.70.0"
version = "0.13.3"
version = "0.13.4"

[profile.release]
lto = true
Expand Down
2 changes: 1 addition & 1 deletion lutra/lutra/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ connector_arrow = {version = "0.6.0", features = ["src_sqlite"]}
env_logger = "0.10.2"
itertools = {workspace = true}
log = {workspace = true}
prqlc = {path = "../../prqlc/prqlc", version = "0.13.3", default-features = false}
prqlc = {path = "../../prqlc/prqlc", version = "0.13.4", default-features = false}
rusqlite = {version = "0.32.0", features = ["bundled"]}
walkdir = "2.5.0"

Expand Down
2 changes: 1 addition & 1 deletion prqlc/bindings/elixir/native/prql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ test = false

# See Readme for details on Mac
[target.'cfg(not(any(target_family="wasm", target_os = "macos")))'.dependencies]
prqlc = {path = "../../../../prqlc", default-features = false, version = "0.13.3" }
prqlc = {path = "../../../../prqlc", default-features = false, version = "0.13.4" }
rustler = "0.36.0"
4 changes: 2 additions & 2 deletions prqlc/bindings/js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion prqlc/bindings/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
"test": "mocha tests"
},
"types": "dist/node/prqlc_js.d.ts",
"version": "0.13.3"
"version": "0.13.4"
}
2 changes: 1 addition & 1 deletion prqlc/packages/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: prqlc
title: PRQL Compiler
base: core22
version: "0.13.3"
version: "0.13.4"
summary: CLI for PRQL, a modern language for transforming data
description: |
prqlc is the CLI for the PRQL compiler. It compiles PRQL to SQL, and offers various diagnostics.
Expand Down
2 changes: 1 addition & 1 deletion prqlc/prqlc-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ proc-macro = true
test = false

[dependencies]
prqlc = {path = "../prqlc", default-features = false, version = "0.13.3" }
prqlc = {path = "../prqlc", default-features = false, version = "0.13.4" }
syn = "2.0.96"

[package.metadata.release]
Expand Down
6 changes: 3 additions & 3 deletions prqlc/prqlc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ test-dbs-external = [
]

[dependencies]
prqlc-parser = { path = "../prqlc-parser", version = "0.13.3" }
prqlc-parser = { path = "../prqlc-parser", version = "0.13.4" }

anstream = { version = "0.6.18", features = ["auto"] }
ariadne = "0.4.1"
ariadne = "0.5.0"
chrono = "0.4.39"
csv = "1.3.1"
enum-as-inner = { workspace = true }
Expand All @@ -70,7 +70,7 @@ serde = { workspace = true }
serde_json = { workspace = true }
serde_yaml = { workspace = true, optional = true }
sqlformat = "0.3.5"
sqlparser = { version = "0.52.0", features = ["serde"] }
sqlparser = { version = "0.53.0", features = ["serde"] }
strum = { version = "0.26.3", features = ["std", "derive"] }
strum_macros = "0.26.4"

Expand Down
10 changes: 5 additions & 5 deletions prqlc/prqlc/src/cli/docs_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ mod tests {
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="prql">
<meta name="generator" content="prqlc 0.13.3">
<meta name="generator" content="prqlc 0.13.4">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<title>PRQL Docs</title>
</head>
Expand Down Expand Up @@ -458,7 +458,7 @@ mod tests {
</main>
<footer class="container border-top">
<small class="text-body-secondary">Generated with <a href="https://prql-lang.org/" rel="external" target="_blank">prqlc</a> 0.13.3.</small>
<small class="text-body-secondary">Generated with <a href="https://prql-lang.org/" rel="external" target="_blank">prqlc</a> 0.13.4.</small>
</footer>
</body>
</html>
Expand Down Expand Up @@ -486,7 +486,7 @@ mod tests {
type user_id = int
";

assert_cmd_snapshot!(prqlc_command().args(["experimental", "doc"]).pass_stdin(input), @r#####"
assert_cmd_snapshot!(prqlc_command().args(["experimental", "doc"]).pass_stdin(input), @r"
success: true
exit_code: 0
----- stdout -----
Expand Down Expand Up @@ -547,10 +547,10 @@ mod tests {
Generated with [prqlc](https://prql-lang.org/) 0.13.3.
Generated with [prqlc](https://prql-lang.org/) 0.13.4.
----- stderr -----
"#####);
");
}

fn prqlc_command() -> Command {
Expand Down
5 changes: 4 additions & 1 deletion prqlc/prqlc/src/debug/render_html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,10 @@ fn write_ast_node_from_object<W: Write>(
let span: Option<String> = properties.remove("span").and_then(|s| match s {
serde_json::Value::Null => None,
serde_json::Value::String(s) => Some(s),
_ => unreachable!("expected span to be string, got: {}", s),
_ => None,
// We previously used to error, but sqlparser now has a type that
// doesn't include spans, so we just ignore it.
// _ => unreachable!("expected span to be string, got: {}", s),
});
let ty: Option<serde_json::Value> = properties.remove("ty");

Expand Down
6 changes: 4 additions & 2 deletions prqlc/prqlc/src/error_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,13 @@ impl ErrorMessage {
// We always pass color to ariadne as true, and then (currently) strip later.
let config = Config::default().with_color(true);

// Create a span tuple with the source path and the error range
let span = Range::from(self.span?);
let error_span = (source_path.clone(), span.start..span.end);

let mut report = Report::build(ReportKind::Error, source_path.clone(), span.start)
let mut report = Report::build(ReportKind::Error, error_span.clone())
.with_config(config)
.with_label(Label::new((source_path, span)).with_message(&self.reason));
.with_label(Label::new(error_span).with_message(&self.reason));

if let Some(code) = &self.code {
report = report.with_code(code);
Expand Down
8 changes: 6 additions & 2 deletions prqlc/prqlc/src/semantic/reporting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ use crate::pr;
use crate::{Result, Span};

pub fn label_references(root_mod: &RootModule, source_id: String, source: String) -> Vec<u8> {
let mut report = Report::build(ReportKind::Custom("Info", Color::Blue), &source_id, 0);
let report_span = (source_id.clone(), 0..source.len());

let mut report = Report::build(ReportKind::Custom("Info", Color::Blue), report_span);

let source = Source::from(source);

Expand Down Expand Up @@ -117,8 +119,10 @@ impl pl::PlFold for Labeler<'_> {
("".to_string(), Color::White)
};

let label_span = (self.source_id.to_string(), span.start..span.end);

self.report.add_label(
Label::new((self.source_id.to_string(), Range::from(span)))
Label::new(label_span)
.with_message(format!("{ident} {decl}"))
.with_color(color),
);
Expand Down
2 changes: 2 additions & 0 deletions prqlc/prqlc/src/sql/gen_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ fn process_concat(expr: &rq::Expr, ctx: &mut Context) -> Result<sql_ast::Expr> {
null_treatment: None,
within_group: vec![],
parameters: sql_ast::FunctionArguments::None,
uses_odbc_syntax: false,
}))
} else {
let concat_args = collect_concat_args(expr);
Expand Down Expand Up @@ -503,6 +504,7 @@ fn translate_datetime_literal_with_sqlite_function(
null_treatment: None,
within_group: vec![],
parameters: sql_ast::FunctionArguments::None,
uses_odbc_syntax: false,
})
}

Expand Down
4 changes: 4 additions & 0 deletions prqlc/prqlc/src/sql/gen_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ pub fn translate_query(query: RelationalQuery, dialect: Option<Dialect>) -> Resu
query.with = Some(sql_ast::With {
recursive,
cte_tables,
with_token: sqlparser::ast::helpers::attached_token::AttachedToken::empty(),
});
}

Expand Down Expand Up @@ -319,6 +320,7 @@ fn translate_relation_expr(relation_expr: RelationExpr, ctx: &mut Context) -> Re
with_ordinality: false,
version: None,
partitions: vec![],
json_path: None,
}
}
RelationExprKind::SubQuery(query) => {
Expand Down Expand Up @@ -428,6 +430,7 @@ fn translate_cte(cte: Cte, ctx: &mut Context) -> Result<(sql_ast::Cte, bool)> {
query: Box::new(query),
from: None,
materialized: None,
closing_paren_token: sqlparser::ast::helpers::attached_token::AttachedToken::empty(),
};
Ok((cte, recursive))
}
Expand Down Expand Up @@ -599,6 +602,7 @@ fn default_select() -> Select {
window_before_qualify: false,
connect_by: None,
prewhere: None,
select_token: sqlparser::ast::helpers::attached_token::AttachedToken::empty(),
}
}

Expand Down
Loading

0 comments on commit 5becae5

Please sign in to comment.