Skip to content

Commit

Permalink
Merge tag 'v0.2.5' into docs
Browse files Browse the repository at this point in the history
dm 0.2.5

- `mutate()`, `transmute()`, `distinct()` and `summarize()` now support `dplyr::across()` and extra arguments (#640).
- Key tracking for the first three verbs is less strict and based on name equality (#663).
- `relocate()` now works on zoomed `dm` objects (#666).
- `dm_add_fk()` gains `on_delete` argument which `copy_dm_to()` picks up and translates to an `ON DELETE CASCADE` or `ON DELETE NO ACTION` specification for the foreign key (#649).
- `dm_copy_to()` defines foreign keys during table creation, for all databases except DuckDB. Tables are created in topological order (#658). For cyclic relationship graphs, table creation is attempted in the original order and may fail (#664).
- `waldo::compare()` shows better output for dm objects (#642).
- `dm_paste()` output uses trailing commas in the `dm::dm()` and `tibble::tibble()` calls, and sorts column attributes by name, for better modularity (#641).

- New `db_schema_create()`, `db_schema_drop()`, `db_schema_exists()` and `db_schema_list()` replace the corresponding `sql_schema_*()` functions, the latter are soft-deprecated (#670). The connection argument to `db_schema_*()` is called `con`, not `dest` (#668).

- `copy_dm_to()` and `sql_create_schema()` no longer actively check for schema existence (#644, #660).
- Add newline after `OUTPUT` clause for SQL Server (#647).
- Fix `sql_rows_delete()` with `returning` argument for SQL Server (#645).

- Remove method only needed for RSQLite < 2.2.8, add warning if loaded RSQLite version is <= 2.2.8 (#632).
- Adapt MSSQL tests to testthat update (#648).
  • Loading branch information
krlmlr committed Oct 16, 2021
2 parents 9cb5ddf + b1a310d commit 0278b10
Show file tree
Hide file tree
Showing 104 changed files with 3,638 additions and 1,015 deletions.
1 change: 1 addition & 0 deletions .github/workflows/R-CMD-check-dev.yaml
Expand Up @@ -241,6 +241,7 @@ jobs:
- name: Install system dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update -y
while read -r cmd
do
eval sudo $cmd
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/R-CMD-check.yaml
Expand Up @@ -109,6 +109,7 @@ jobs:
- name: Install system dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update -y
while read -r cmd
do
eval sudo $cmd
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pkgdown.yaml
Expand Up @@ -92,6 +92,7 @@ jobs:
- name: Install system dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update -y
while read -r cmd
do
eval sudo $cmd
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/revdep.yaml
Expand Up @@ -112,6 +112,7 @@ jobs:
- name: Install system dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update -y
Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "18.04")); package <- "${{ matrix.package }}"; deps <- tools::package_dependencies(package, which = "Suggests")[[1]]; lapply(c(package, deps), function(x) { writeLines(remotes::system_requirements("ubuntu", "18.04", package = x)) })' | sort | uniq > .github/deps.sh
cat .github/deps.sh
sudo sh < .github/deps.sh
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-coverage.yaml
Expand Up @@ -66,6 +66,7 @@ jobs:
- name: Install system dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update -y
while read -r cmd
do
eval sudo $cmd
Expand Down
130 changes: 130 additions & 0 deletions .github/workflows/validate.yaml
@@ -0,0 +1,130 @@
on:
push:
branches:
- main
- master
- "r-*"
pull_request:
branches:
- main
- master
- "r-*"
schedule:
- cron: '20 2 * * *'

name: validate

jobs:
db-tests:
runs-on: ${{ matrix.config.os }}${{ matrix.config.os-version }}

name: ${{ matrix.config.os }}${{ matrix.config.os-version }} (${{ matrix.config.r }}) ${{ matrix.config.desc }}

# Begin custom: services
# End custom: services

strategy:
fail-fast: false
matrix:
config:
- { os: ubuntu-, os-version: 18.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest" }

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# prevent rgl issues because no X11 display is available
RGL_USE_NULL: true
# Begin custom: env vars
# End custom: env vars

steps:
- name: Check rate limits
run: |
curl -s --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/rate_limit
shell: bash

- uses: actions/checkout@v2

# Begin custom: before install
# End custom: before install

- uses: r-lib/actions/setup-r@v1
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}

- name: Install remotes
run: |
if (!requireNamespace("curl", quietly = TRUE)) install.packages("curl")
if (!requireNamespace("remotes", quietly = TRUE)) install.packages("remotes")
shell: Rscript {0}

- name: Query dependencies
if: runner.os != 'Windows'
run: |
saveRDS(remotes::dev_package_deps(dependencies = TRUE, type = .Platform$pkgType), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Restore R package cache
if: runner.os != 'Windows'
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ matrix.config.os }}${{ matrix.config.os-version }}-${{ hashFiles('.github/R-version') }}-2-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ matrix.config.os }}${{ matrix.config.os-version }}-${{ hashFiles('.github/R-version') }}-2-

- name: Install system dependencies
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "${{matrix.config.os-version}}"))')
# Begin custom: before install
# End custom: before install

- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE, type = .Platform$pkgType)
shell: Rscript {0}

- name: Instrument R code for validation
run: |
if [ $(git status --porcelain | wc -l) -gt 0 ]; then
echo "Fatal: git working copy not clean"
fi
sed -i -r '/INSTRUMENT: validate/ s/^( +)# /\1/g' R/*
if [ $(git status --porcelain | wc -l) -eq 0 ]; then
echo "Fatal: substitution did not change anything"
fi
# Begin custom: after install
- name: Run tests
run: |
testthat::test_local(reporter = testthat::ProgressReporter$new(max_failures = Inf, update_interval = Inf))
shell: Rscript {0}
# End custom: after install

- name: Run tests
run: |
testthat::test_local(reporter = testthat::ProgressReporter$new(max_failures = Inf, update_interval = Inf))
shell: Rscript {0}

- name: Show test output
if: always()
run: |
find check -name '*.Rout*' -exec head -n 1000000 '{}' \; || true
shell: bash

- name: Test coverage
run: covr::codecov()
shell: Rscript {0}

- name: Check rate limits
if: always()
run: |
curl -s --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/rate_limit
shell: bash
12 changes: 7 additions & 5 deletions DESCRIPTION
@@ -1,7 +1,7 @@
Package: dm
Title: Relational Data Models
Version: 0.2.3
Date: 2021-06-20
Version: 0.2.5
Date: 2021-10-15
Authors@R:
c(person(given = "Tobias",
family = "Schieferdecker",
Expand Down Expand Up @@ -49,7 +49,7 @@ Imports:
magrittr,
memoise,
methods,
pillar,
pillar (>= 1.6.2),
purrr,
rlang (>= 0.4.10),
tibble,
Expand All @@ -71,20 +71,22 @@ Suggests:
mockr,
nycflights13,
odbc,
pool,
progress,
RMariaDB (>= 1.0.10),
rmarkdown,
RPostgres,
RSQLite,
RSQLite (>= 2.2.8),
testthat (>= 3.0.2),
tidyverse,
waldo,
withr
VignetteBuilder:
knitr
Encoding: UTF-8
Roxygen: list(markdown = TRUE, roclets = c("collate",
"namespace", "rd"))
RoxygenNote: 7.1.1.9001
RoxygenNote: 7.1.2
Config/testthat/edition: 3
Config/testthat/parallel: true
Config/testthat/start-first: zzx-deprecated, flatten, dplyr, filter-dm, draw-dm, bind, rows-dm
68 changes: 48 additions & 20 deletions NAMESPACE
Expand Up @@ -26,6 +26,23 @@ S3method(compute,zoomed_dm)
S3method(copy_to,dm)
S3method(count,dm)
S3method(count,zoomed_dm)
S3method(db_schema_create,"Microsoft SQL Server")
S3method(db_schema_create,PqConnection)
S3method(db_schema_create,SQLiteConnection)
S3method(db_schema_create,src_dbi)
S3method(db_schema_drop,"Microsoft SQL Server")
S3method(db_schema_drop,PqConnection)
S3method(db_schema_drop,SQLiteConnection)
S3method(db_schema_drop,src_dbi)
S3method(db_schema_exists,"Microsoft SQL Server")
S3method(db_schema_exists,PqConnection)
S3method(db_schema_exists,SQLiteConnection)
S3method(db_schema_exists,src_dbi)
S3method(db_schema_list,"Microsoft SQL Server")
S3method(db_schema_list,Pool)
S3method(db_schema_list,PqConnection)
S3method(db_schema_list,SQLiteConnection)
S3method(db_schema_list,src_dbi)
S3method(dim,zoomed_dm)
S3method(dimnames,zoomed_dm)
S3method(distinct,dm)
Expand All @@ -38,6 +55,7 @@ S3method(format,zoomed_df)
S3method(format,zoomed_dm)
S3method(full_join,dm)
S3method(full_join,zoomed_dm)
S3method(glimpse,dm)
S3method(group_by,dm)
S3method(group_by,zoomed_dm)
S3method(group_data,dm)
Expand Down Expand Up @@ -69,15 +87,19 @@ S3method(pull,dm)
S3method(pull,zoomed_dm)
S3method(pull_tbl,dm)
S3method(pull_tbl,zoomed_dm)
S3method(relocate,dm)
S3method(relocate,zoomed_dm)
S3method(rename,dm)
S3method(rename,zoomed_dm)
S3method(right_join,dm)
S3method(right_join,zoomed_dm)
S3method(rows_delete,tbl_dbi)
S3method(rows_insert,tbl_dbi)
S3method(rows_patch,tbl_dbi)
S3method(rows_truncate,data.frame)
S3method(rows_truncate,tbl_sql)
S3method(rows_update,tbl_dbi)
S3method(rows_upsert,tbl_dbi)
S3method(select,dm)
S3method(select,zoomed_dm)
S3method(semi_join,dm)
Expand All @@ -86,32 +108,28 @@ S3method(separate,dm)
S3method(separate,zoomed_dm)
S3method(slice,dm)
S3method(slice,zoomed_dm)
S3method(sql_output_cols,"tbl_Microsoft SQL Server")
S3method(sql_output_cols,default)
S3method(sql_returning_cols,"tbl_Microsoft SQL Server")
S3method(sql_returning_cols,tbl_dbi)
S3method(sql_returning_cols,tbl_duckdb_connection)
S3method(sql_rows_delete,tbl_sql)
S3method(sql_rows_insert,tbl_sql)
S3method(sql_rows_patch,"tbl_Microsoft SQL Server")
S3method(sql_rows_patch,tbl_MariaDBConnection)
S3method(sql_rows_patch,tbl_sql)
S3method(sql_rows_truncate,tbl_SQLiteConnection)
S3method(sql_rows_truncate,tbl_duckdb_connection)
S3method(sql_rows_truncate,tbl_sql)
S3method(sql_rows_update,"tbl_Microsoft SQL Server")
S3method(sql_rows_update,tbl_MariaDBConnection)
S3method(sql_rows_update,tbl_PqConnection)
S3method(sql_rows_update,tbl_SQLiteConnection)
S3method(sql_rows_update,tbl_duckdb_connection)
S3method(sql_schema_create,"Microsoft SQL Server")
S3method(sql_schema_create,PqConnection)
S3method(sql_schema_create,SQLiteConnection)
S3method(sql_schema_create,src_dbi)
S3method(sql_schema_drop,"Microsoft SQL Server")
S3method(sql_schema_drop,PqConnection)
S3method(sql_schema_drop,SQLiteConnection)
S3method(sql_schema_drop,src_dbi)
S3method(sql_schema_exists,"Microsoft SQL Server")
S3method(sql_schema_exists,PqConnection)
S3method(sql_schema_exists,SQLiteConnection)
S3method(sql_schema_exists,src_dbi)
S3method(sql_schema_list,"Microsoft SQL Server")
S3method(sql_schema_list,PqConnection)
S3method(sql_schema_list,SQLiteConnection)
S3method(sql_schema_list,src_dbi)
S3method(sql_rows_update,tbl_sql)
S3method(sql_rows_upsert,"tbl_Microsoft SQL Server")
S3method(sql_rows_upsert,tbl_MariaDBConnection)
S3method(sql_rows_upsert,tbl_PqConnection)
S3method(sql_rows_upsert,tbl_SQLiteConnection)
S3method(sql_rows_upsert,tbl_duckdb_connection)
S3method(sql_rows_upsert,tbl_sql)
S3method(src_tbls,dm)
S3method(str,dm)
S3method(str,zoomed_dm)
Expand Down Expand Up @@ -196,6 +214,10 @@ export(collect)
export(compute)
export(copy_dm_to)
export(copy_to)
export(db_schema_create)
export(db_schema_drop)
export(db_schema_exists)
export(db_schema_list)
export(decompose_table)
export(dm)
export(dm_add_fk)
Expand Down Expand Up @@ -258,7 +280,10 @@ export(enum_pk_candidates)
export(examine_cardinality)
export(filter)
export(full_join)
export(get_returned_rows)
export(glimpse)
export(group_by)
export(has_returned_rows)
export(inner_join)
export(is_dm)
export(left_join)
Expand All @@ -278,8 +303,11 @@ export(rows_upsert)
export(select)
export(semi_join)
export(separate)
export(sql_output_cols)
export(sql_returning_cols)
export(sql_rows_delete)
export(sql_rows_insert)
export(sql_rows_patch)
export(sql_rows_truncate)
export(sql_rows_update)
export(sql_schema_create)
Expand All @@ -306,7 +334,6 @@ import(rlang)
import(tibble)
import(tidyr, except = c(extract))
importFrom(glue,glue)
importFrom(glue,glue_sql)
importFrom(grDevices,col2rgb)
importFrom(grDevices,colors)
importFrom(grDevices,rgb)
Expand Down Expand Up @@ -335,6 +362,7 @@ importFrom(vctrs,vec_proxy_compare)
importFrom(vctrs,vec_ptype2)
importFrom(vctrs,vec_ptype_abbr)
importFrom(vctrs,vec_rbind)
importFrom(vctrs,vec_recycle)
importFrom(vctrs,vec_size)
importFrom(vctrs,vec_slice)
importFrom(vctrs,vec_split)

0 comments on commit 0278b10

Please sign in to comment.