Skip to content

Commit d296b66

Browse files
committed
rebuild and recheck
1 parent 1f856a9 commit d296b66

File tree

138 files changed

+1711
-1599
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+1711
-1599
lines changed

NEWS.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11

22
# rquery 1.3.8 2019/09/15
33

4-
* YAML path.
4+
* Add YAML path for operator trees.
55
* Auto-register rqdatatable as default executor on load, if available.
6+
* Fix column name quoting issue in operator presentation.
67
* Alternate operator names.
78

89
# rquery 1.3.7 2019/07/29

R/extend.R

+13-17
Original file line numberDiff line numberDiff line change
@@ -330,32 +330,28 @@ format_node.relop_extend <- function(node) {
330330
if(!is.null(node$display_form)) {
331331
return(node$display_form)
332332
}
333-
pterms <- ""
334-
if(length(node$partitionby)>0) {
335-
pterms <- paste0(",\n p= ",
336-
paste(node$partitionb, collapse = ", "))
337-
}
338-
oterms <- ""
339-
ocols <- NULL
340-
if(length(node$orderby)>0) {
341-
ocols <- paste0("\"", node$orderby, "\"")
342-
if(length(node$reverse)>0) {
343-
ocols[node$orderby %in% node$reverse] <- paste(ocols[node$orderby %in% node$reverse], "DESC")
344-
}
345-
}
346-
if(length(ocols)>0) {
347-
oterms <- paste0(",\n o= ",
348-
paste(ocols, collapse = ", "))
349-
}
350333
origTerms <- vapply(node$parsed,
351334
function(pi) {
352335
paste(as.character(pi$presentation), collapse = ' ')
353336
}, character(1))
354337
aterms <- paste(origTerms, collapse = ",\n ")
338+
pterms <- ""
339+
oterms <- ""
340+
rterms <- ""
341+
if(length(node$partitionby)>0) {
342+
pterms <- paste0(",\n partitionby = ", wrapr::map_to_char(node$partitionby))
343+
}
344+
if(length(node$partitionby)>0) {
345+
oterms <- paste0(",\n orderby = ", wrapr::map_to_char(node$orderby))
346+
}
347+
if(length(node$partitionby)>0) {
348+
rterms <- paste0(",\n reverse = ", wrapr::map_to_char(node$reverse))
349+
}
355350
paste0("extend(.,\n ",
356351
aterms,
357352
pterms,
358353
oterms,
354+
rterms,
359355
")",
360356
"\n")
361357
}

R/natural_join.R

+3-3
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,10 @@ format.relop_natural_join <- function(x, ...) {
178178
" %.>%\n ",
179179
"natural_join(.,\n",
180180
" ", b, ",\n",
181-
" j= ",
181+
" jointype = \"",
182182
x$jointype,
183-
", by= ",
184-
paste(x$by, collapse = ", "),
183+
"\", by = ",
184+
wrapr::map_to_char(x$by),
185185
")",
186186
"\n")
187187
}

R/order_by.R

+4-12
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,10 @@ orderby.data.frame <- function(source,
110110

111111
#' @export
112112
format_node.relop_orderby <- function(node) {
113-
ot <- node$orderby
114-
if(length(node$reverse)>0) {
115-
ot[ot %in% node$reverse] <- paste0("desc(", ot[ot %in% node$reverse], ")")
116-
}
117-
paste0("orderby(., ",
118-
ifelse(length(ot)>0,
119-
paste(ot, collapse = ", "),
120-
""),
121-
ifelse((length(node$limit)>0) && (length(node$orderby)>0),
122-
paste0(", LIMIT ",
123-
format(ceiling(node$limit), scientific = FALSE)),
124-
""),
113+
paste0("order_rows(.",
114+
",\n ", wrapr::map_to_char(node$orderby),
115+
",\n reverse = ", wrapr::map_to_char(node$reverse),
116+
",\n limit = ", ifelse(is.null(node$limit), "NULL", node$limit),
125117
")",
126118
"\n")
127119
}

R/project.R

+1-2
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,7 @@ format_node.relop_project <- function(node) {
220220
aterms <- paste(origTerms, collapse = ", ")
221221
paste0("project(., ",
222222
aterms,
223-
",\n g= ",
224-
paste(node$groupby, collapse = ", "),
223+
",\n groupby = ", wrapr::map_to_char(node$groupby),
225224
")",
226225
"\n")
227226
}

R/select_columns.R

+4-3
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ column_names.relop_select_columns <- function (x, ...) {
7070

7171
#' @export
7272
format_node.relop_select_columns <- function(node) {
73-
paste0("select_columns(.,\n ",
74-
paste(node$columns, collapse = ", "),
75-
")",
73+
cols <- paste0('"', node$columns, '"')
74+
paste0("select_columns(., c(\n ",
75+
paste(cols, collapse = ", "),
76+
"))",
7677
"\n")
7778
}
7879

R/table_source.R

+3-3
Original file line numberDiff line numberDiff line change
@@ -338,13 +338,13 @@ to_sql_relop_table_source <- function(
338338
#' @export
339339
format_node.relop_table_source <- function(node) {
340340
max_cols <- 20
341-
cols <- node$columns
341+
cols <- paste0('"', node$columns, '"')
342342
if(length(cols)>max_cols) {
343343
cols <- c(cols[seq_len(max_cols)], "...")
344344
}
345-
paste0("table(", node$q_table_name, "; \n ",
345+
paste0("mk_td(\"", node$q_table_name, "\", c(\n ",
346346
paste(cols, collapse = ",\n "),
347-
")\n")
347+
"))\n")
348348
}
349349

350350

README.md

+29-23
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ rq_copy_to(db, 'd',
228228
overwrite = TRUE)
229229
```
230230

231-
## [1] "table(\"d\"; subjectID, surveyCategory, assessmentTotal, irrelevantCol1, irrelevantCol2)"
231+
## [1] "mk_td(\"\"d\"\", c( \"subjectID\", \"surveyCategory\", \"assessmentTotal\", \"irrelevantCol1\", \"irrelevantCol2\"))"
232232

233233
``` r
234234
# produce a hande to existing table
@@ -279,7 +279,7 @@ class(d)
279279
print(d)
280280
```
281281

282-
## [1] "table(\"d\"; subjectID, surveyCategory, assessmentTotal, irrelevantCol1, irrelevantCol2)"
282+
## [1] "mk_td(\"\"d\"\", c( \"subjectID\", \"surveyCategory\", \"assessmentTotal\", \"irrelevantCol1\", \"irrelevantCol2\"))"
283283

284284
``` r
285285
# remote structure inspection
@@ -350,7 +350,7 @@ class(result)
350350
result
351351
```
352352

353-
## [1] "table(\"rquery_mat_46472544534830976230_0000000000\"; subjectID, diagnosis, probability)"
353+
## [1] "mk_td(\"\"rquery_mat_72197415925085797270_0000000000\"\", c( \"subjectID\", \"diagnosis\", \"probability\"))"
354354

355355
``` r
356356
DBI::dbReadTable(db$connection, result$table_name) %.>%
@@ -430,14 +430,14 @@ cat(to_sql(dq, db, source_limit = 1000))
430430
"assessmentTotal"
431431
FROM
432432
"d" LIMIT 1000
433-
) tsql_95158266591829713371_0000000000
434-
) tsql_95158266591829713371_0000000001
435-
) tsql_95158266591829713371_0000000002
436-
) tsql_95158266591829713371_0000000003
433+
) tsql_14421193931461477387_0000000000
434+
) tsql_14421193931461477387_0000000001
435+
) tsql_14421193931461477387_0000000002
436+
) tsql_14421193931461477387_0000000003
437437
WHERE "row_number" <= 1
438-
) tsql_95158266591829713371_0000000004
439-
) tsql_95158266591829713371_0000000005
440-
) tsql_95158266591829713371_0000000006 ORDER BY "subjectID"
438+
) tsql_14421193931461477387_0000000004
439+
) tsql_14421193931461477387_0000000005
440+
) tsql_14421193931461477387_0000000006 ORDER BY "subjectID"
441441

442442
The query is large, but due to its regular structure it should be very
443443
amenable to query optimization.
@@ -485,28 +485,34 @@ The flow itself is represented as follows:
485485
cat(format(dq))
486486
```
487487

488-
table("d";
489-
subjectID,
490-
surveyCategory,
491-
assessmentTotal,
492-
irrelevantCol1,
493-
irrelevantCol2) %.>%
488+
mk_td(""d"", c(
489+
"subjectID",
490+
"surveyCategory",
491+
"assessmentTotal",
492+
"irrelevantCol1",
493+
"irrelevantCol2")) %.>%
494494
extend(.,
495495
probability := exp(assessmentTotal * 0.237)) %.>%
496496
extend(.,
497497
probability := probability / sum(probability),
498-
p= subjectID) %.>%
498+
partitionby = c('subjectID'),
499+
orderby = c(),
500+
reverse = c()) %.>%
499501
extend(.,
500502
row_number := row_number(),
501-
p= subjectID,
502-
o= "probability" DESC, "surveyCategory") %.>%
503+
partitionby = c('subjectID'),
504+
orderby = c('probability', 'surveyCategory'),
505+
reverse = c('probability')) %.>%
503506
select_rows(.,
504507
row_number <= 1) %.>%
505-
rename(.,
508+
rename_columns(.,
506509
c('diagnosis' = 'surveyCategory')) %.>%
507-
select_columns(.,
508-
subjectID, diagnosis, probability) %.>%
509-
orderby(., subjectID)
510+
select_columns(., c(
511+
"subjectID", "diagnosis", "probability")) %.>%
512+
order_rows(.,
513+
c('subjectID'),
514+
reverse = c(),
515+
limit = NULL)
510516

511517
``` r
512518
dq %.>%

cran-comments.md

+13-17
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44

55
### OSX (local machine using --as-cran from the command line)
66

7-
R CMD check --as-cran rquery_1.3.7.tar.gz
7+
R CMD check --as-cran rquery_1.3.8.tar.gz
88
* using R version 3.6.0 (2019-04-26)
99
* using platform: x86_64-apple-darwin15.6.0 (64-bit)
1010
* using session charset: UTF-8
1111
* using option ‘--as-cran’
1212
* checking for file ‘rquery/DESCRIPTION’ ... OK
1313
* checking extension type ... Package
14-
* this is package ‘rquery’ version ‘1.3.7
14+
* this is package ‘rquery’ version ‘1.3.8
1515
* package encoding: UTF-8
1616
* checking CRAN incoming feasibility ... Note_to_CRAN_maintainers
1717
Maintainer: ‘John Mount <[email protected]>’
@@ -20,24 +20,20 @@
2020
### Windows
2121

2222
rhub::check_for_cran()
23-
822#> * using R Under development (unstable) (2019-07-04 r76780)
24-
823#> * using platform: x86_64-w64-mingw32 (64-bit)
25-
824#> * using session charset: ISO8859-1
26-
825#> * using option '--as-cran'
27-
826#> * checking for file 'rquery/DESCRIPTION' ... OK
28-
827#> * checking extension type ... Package
29-
828#> * this is package 'rquery' version '1.3.7'
30-
829#> * package encoding: UTF-8
31-
830#> * checking CRAN incoming feasibility ... Note_to_CRAN_maintainers
32-
831#> Maintainer: 'John Mount '
33-
885#> * DONE
34-
886#> Status: OK
23+
831#> * using R Under development (unstable) (2019-08-30 r77101)
24+
832#> * using platform: x86_64-w64-mingw32 (64-bit)
25+
833#> * using session charset: ISO8859-1
26+
834#> * using option '--as-cran'
27+
835#> * checking for file 'rquery/DESCRIPTION' ... OK
28+
836#> * checking extension type ... Package
29+
837#> * this is package 'rquery' version '1.3.8'
30+
838#> * package encoding: UTF-8
31+
839#> * checking CRAN incoming feasibility ... Note_to_CRAN_maintainers
32+
840#> Maintainer: 'John Mount '
33+
896#> Status: OK
3534

3635
## Reverse dependencies
3736

3837
Checked https://github.com/WinVector/rquery/blob/master/extras/check_reverse_dependencies.md
39-
## cdata_1.1.1 started at 2019-07-29 09:21:48 success at 2019-07-29 09:22:22 (1/0/0)
40-
## rqdatatable_1.1.9 started at 2019-07-29 09:22:22 success at 2019-07-29 09:22:53 (2/0/0)
41-
## Test of rquery had 2 successes, 0 failures, and 0 skipped packages.
4238

4339
Note: "Edgar F. Codd", "SQL", and "observable" are all spelled correctly.

docs/LICENSE-text.html

+4-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)