From e1aac3f396f62704eaa8f85e0f3da754d0decce5 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Sun, 26 May 2024 13:47:32 +0800 Subject: [PATCH] Add NEWS * Improve DESCRIPTION: add R dependency (prepare to use native pipe over magrittr pipe), pin crul version * Improve ckanr-package author email * Fix dbplyr_edition generics * Suggest new package version 0.8.0 --- DESCRIPTION | 6 +++-- NAMESPACE | 3 ++- NEWS.md | 25 ++++++++++++++++++- R/ckanr-package.R | 2 +- R/dplyr.R | 14 ++++++++--- man/ckanr-package.Rd | 2 +- ...ss.Rd => dbplyr_edition.CKANConnection.Rd} | 10 ++++---- man/dbplyr_edition.src_ckan.Rd | 15 +++++++++++ 8 files changed, 62 insertions(+), 15 deletions(-) rename man/{dbplyr_edition.myConnectionClass.Rd => dbplyr_edition.CKANConnection.Rd} (64%) create mode 100644 man/dbplyr_edition.src_ckan.Rd diff --git a/DESCRIPTION b/DESCRIPTION index a4ae330..004a2bb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -34,12 +34,14 @@ BugReports: https://github.com/ropensci/ckanr/issues Encoding: UTF-8 Language: en-US Roxygen: list(markdown = TRUE) -Depends: DBI (>= 0.3.1) +Depends: + DBI (>= 1.2.2), + R (>= 4.4.0) Imports: methods, stats, utils, - crul, + crul (>= 1.4.2), jsonlite (>= 1.8.8), dplyr (>= 1.1.4), dbplyr (>= 2.5.0), diff --git a/NAMESPACE b/NAMESPACE index 506d401..23fb8f6 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -25,7 +25,8 @@ S3method(db_begin,CKANConnection) S3method(db_has_table,CKANConnection) S3method(db_insert_into,CKANConnection) S3method(db_query_rows,CKANConnection) -S3method(dbplyr_edition,myConnectionClass) +S3method(dbplyr_edition,CKANConnection) +S3method(dbplyr_edition,src_ckan) S3method(format,src_ckan) S3method(print,ckan_group) S3method(print,ckan_organization) diff --git a/NEWS.md b/NEWS.md index 481b005..d730719 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,28 @@ # ckanr (development version) +ckanr 0.8.0 +=========== + +### NEW FEATURES + +* upgrades deprecated `dbplyr` generics (#187, @florianm) + + Following [dbplyr's 2.0.0 backend API](https://dbplyr.tidyverse.org/articles/backend-2.html), + scripts using `ckanr`'s SQL `CKANConnection` must implement the following + changes: + + * change `dplyr::sql_translate_env` to `dbplyr::sql_translation` + * change `dplyr::db_explain` to `dbplyr::sql_query_explain` + * change `dplyr::db_query_fields` to `dbplyr::sql_query_fields` + * change `dplyr::sql_subquery` to `dbplyr::sql_query_wrap` + * change `dplyr::sql_select` to `dbplyr::sql_query_select` + * all other generics are unchanged. +* updates dependencies (R, DBI, jsonlite, dplyr, dbplyr, RoxygenNote) + +### MINOR IMPROVEMENTS + +* update manpage author list (add SG, FA), author email (FM) + ckanr 0.7.0 =========== @@ -81,7 +104,7 @@ ckanr 0.3.0 * `package_show()` gains `key` parameter to pass an API key (#97) * `package_search()` gains new parameters: `include_drafts`, `include_private`, `use_default_schema`, and `facet.mincount` (#107) * function `fetch()` changed to `ckan_fetch()` -* gains function `organization_delet()` to delete an organization (#83) +* gains function `organization_delete()` to delete an organization (#83) * gains function `ckan_version()` to get version info for a CKAN instance * gains methods for creating a CKAN remote instance as a dplyr backend: gains `src_ckan()` and it's s3 methods `tbl` and `src_tbls`, `sql_translate_env`. in addition gains the S3 methods `db_begin`, `db_explain`, `db_has_table`, `db_insert_into`, `db_query_fields`, `db_query_rows` diff --git a/R/ckanr-package.R b/R/ckanr-package.R index 3d304b1..d313861 100644 --- a/R/ckanr-package.R +++ b/R/ckanr-package.R @@ -68,7 +68,7 @@ #' @aliases ckanr #' @docType package #' @author Scott Chamberlain \email{myrmecocystus@@gmail.com} -#' @author Florian Mayer \email{florian.wendelin.mayer@@gmail.com} +#' @author Florian Mayer \email{florian.wendelin.mayer+ckanr@@gmail.com} #' @author Wush Wu #' @author Imanuel Costigan \email{i.costigan@@me.com} #' @author Sharla Gelfand diff --git a/R/dplyr.R b/R/dplyr.R index c6b402d..60d33ed 100644 --- a/R/dplyr.R +++ b/R/dplyr.R @@ -156,14 +156,20 @@ db_query_rows.CKANConnection <- function(con, sql, ...) { #' Use dbplyr 2.0.0 generics #' See https://dbplyr.tidyverse.org/articles/backend-2.html#nd-edition -#' New in 0.7.0.9001 +#' Introduced in 0.8.0 #' @importFrom dbplyr dbplyr_edition #' @export -dbplyr_edition.myConnectionClass <- function(con) 2L +dbplyr_edition.CKANConnection <- function(con) 2L + +#' Use dbplyr 2.0.0 generics +#' See https://dbplyr.tidyverse.org/articles/backend-2.html#nd-edition +#' Introduced in 0.8.0 +#' @importFrom dbplyr dbplyr_edition +#' @export +dbplyr_edition.src_ckan <- function(con) 2L #' @importFrom dplyr db_list_tables sql #' @importFrom dbplyr base_agg base_scalar base_win build_sql sql_prefix #' sql_translator sql_variant src_sql tbl_sql -#' sql_query_fields -#' sql_query_select sql_query_wrap sql_query_explain sql_translation +#' sql_query_fields sql_query_select sql_query_wrap sql_query_explain sql_translation NULL diff --git a/man/ckanr-package.Rd b/man/ckanr-package.Rd index f946edb..3a892c6 100644 --- a/man/ckanr-package.Rd +++ b/man/ckanr-package.Rd @@ -87,7 +87,7 @@ Useful links: \author{ Scott Chamberlain \email{myrmecocystus@gmail.com} -Florian Mayer \email{florian.wendelin.mayer@gmail.com} +Florian Mayer \email{florian.wendelin.mayer+ckanr@gmail.com} Wush Wu diff --git a/man/dbplyr_edition.myConnectionClass.Rd b/man/dbplyr_edition.CKANConnection.Rd similarity index 64% rename from man/dbplyr_edition.myConnectionClass.Rd rename to man/dbplyr_edition.CKANConnection.Rd index d7ed221..0bf2917 100644 --- a/man/dbplyr_edition.myConnectionClass.Rd +++ b/man/dbplyr_edition.CKANConnection.Rd @@ -1,15 +1,15 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/dplyr.R -\name{dbplyr_edition.myConnectionClass} -\alias{dbplyr_edition.myConnectionClass} +\name{dbplyr_edition.CKANConnection} +\alias{dbplyr_edition.CKANConnection} \title{Use dbplyr 2.0.0 generics See https://dbplyr.tidyverse.org/articles/backend-2.html#nd-edition -New in 0.7.0.9001} +Introduced in 0.8.0} \usage{ -\method{dbplyr_edition}{myConnectionClass}(con) +\method{dbplyr_edition}{CKANConnection}(con) } \description{ Use dbplyr 2.0.0 generics See https://dbplyr.tidyverse.org/articles/backend-2.html#nd-edition -New in 0.7.0.9001 +Introduced in 0.8.0 } diff --git a/man/dbplyr_edition.src_ckan.Rd b/man/dbplyr_edition.src_ckan.Rd new file mode 100644 index 0000000..adc8873 --- /dev/null +++ b/man/dbplyr_edition.src_ckan.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/dplyr.R +\name{dbplyr_edition.src_ckan} +\alias{dbplyr_edition.src_ckan} +\title{Use dbplyr 2.0.0 generics +See https://dbplyr.tidyverse.org/articles/backend-2.html#nd-edition +Introduced in 0.8.0} +\usage{ +\method{dbplyr_edition}{src_ckan}(con) +} +\description{ +Use dbplyr 2.0.0 generics +See https://dbplyr.tidyverse.org/articles/backend-2.html#nd-edition +Introduced in 0.8.0 +}