Skip to content

Commit 8b1bd94

Browse files
committed
fix group_by all support
1 parent d27104a commit 8b1bd94

File tree

6 files changed

+10
-2
lines changed

6 files changed

+10
-2
lines changed

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# TidierDB.jl updates
2+
##v.8.10 - 2025-08-15
3+
- `@arrange` can accept numeric values for columns
4+
- bug fix when using `@group_by(all)` or `_by = all`
5+
26
##v.8.9 - 2025-08-08
37
- fixes window keyword parsing in `@mutate` that breaking nightly runs
48

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "TidierDB"
22
uuid = "86993f9b-bbba-4084-97c5-ee15961ad48b"
33
authors = ["Daniel Rizk <rizk.daniel.12@gmail.com> and contributors"]
4-
version = "0.8.9"
4+
version = "0.8.10"
55

66
[deps]
77
Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ TidierDB.jl currently supports the following top-level macros:
4848
| **Aggregate Functions** | `mean`, `minimum`, `maximum`, `std`, `sum`, `cumsum`, and nearly all aggregate sql fxns supported |
4949
| **Window Functions** | `lead`, `lag`, `dense_rank`, `nth_value`, `ntile`, `rank_dense`, `row_number`, `first_value`, `last_value`, `cume_dist`, `@window_order`, `@window_frame`, or `_by`, `_order`, and `_frame` within `@mutate` |
5050
|**Unnesting** | `@unnest_wider` and `@unnest_longer` |
51+
|**Pivoting** | `@pivot_longer` and `@pivot_wider` |
5152

5253
`@summarize` supports any SQL aggregate function in addition to the list above. Simply write the function as written in SQL syntax and it will work.
5354
`@mutate` supports all builtin SQL functions as well.

docs/src/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ TidierDB.jl currently supports:
4343
| **Aggregate Functions** | `mean`, `minimum`, `maximum`, `std`, `sum`, `cumsum`, and nearly all aggregate sql fxns supported |
4444
| **Window Functions** | `lead`, `lag`, `dense_rank`, `nth_value`, `ntile`, `rank_dense`, `row_number`, `first_value`, `last_value`, `cume_dist`, `@window_order`, `@window_frame`, or `_by`, `_order`, and `_frame` within `@mutate` |
4545
|**Unnesting** | `@unnest_wider` and `@unnest_longer` |
46+
|**Pivoting** | `@pivot_longer` and `@pivot_wider` |
4647

4748
`@summarize` supports any SQL aggregate function in addition to the list above. Simply write the function as written in SQL syntax and it will work.
4849
`@mutate` supports all builtin SQL functions as well.

src/TidierDB_macros.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ function _colref_to_string(col)
136136
parent_str = _colref_to_string(col.args[1])
137137
field_str = string(col.args[2].value)
138138
return parent_str * "." * field_str
139+
elseif isa(col, Integer)
140+
return string(col)
139141
else
140142
throw("Unsupported column reference: $col")
141143
end

src/structs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ function finalize_query(sqlquery::SQLQuery)
332332
r"var\"(.*?)\"" => s"\1", r"\"\\\$" => "\"\$", "WHERE \"" => "WHERE ", "WHERE \"NOT" => "WHERE NOT", "%')\"" =>"%\")", "NULL)\"" => "NULL)",
333333
"NULL))\"" => "NULL))", r"(?i)INTERVAL(\d+)([a-zA-Z]+)" => s"INTERVAL \1 \2", "SELECT SUMMARIZE " => "SUMMARIZE ", "\"(__(" => "(", ")__(\"" => ")"
334334
, "***\"" => " ", "\"***" => " ", "***" => " ", "WHERE WHERE " => "WHERE ", "WHERE WHERE " => "WHERE ", "(__(" => "", ")__(" => "", "SELECT , CONCAT_WS" => "SELECT CONCAT_WS")
335-
complete_query = replace(complete_query, ", AS " => " AS ", "OR \"" => "OR ")
335+
complete_query = replace(complete_query, ", AS " => " AS ", "OR \"" => "OR ", "SELECT all," => "SELECT ")
336336
if current_sql_mode[] == postgres() || current_sql_mode[] == duckdb() || current_sql_mode[] == mysql() || current_sql_mode[] == mssql() || current_sql_mode[] == clickhouse() || current_sql_mode[] == athena() || current_sql_mode[] == gbq() || current_sql_mode[] == oracle() || current_sql_mode[] == snowflake() || current_sql_mode[] == databricks()
337337
complete_query = replace(complete_query, "\"" => "'", "==" => "=")
338338
end

0 commit comments

Comments
 (0)