Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New format_dataset() and format_table() #81

Merged
merged 12 commits into from Jan 29, 2016

Conversation

@krlmlr
Copy link
Member

commented Jan 26, 2016

as complement to parse_*().

@craigcitro: Okay to create a new file for these functions and move them out of utils.R? If not, I'll revert that particular change before adding tests.

R/id.R Outdated
#' @family identifier functions
#' @export
parse_dataset <- function(dataset, project_id = NULL) {
assert_that(is.string(dataset), is.null(project_id) || is.string(project_id))

This comment has been minimized.

Copy link
@craigcitro

craigcitro Jan 29, 2016

Collaborator

small nit: i think this is easier to read when each assertion is on its own line, eg

assert_that(is.string(dataset),
            is_null(project_id) || is.string(project_id))
list(project_id = project_id, dataset_id = dataset_id)
}

#' Format dataset and project ID as a BQ-style identifier

This comment has been minimized.

Copy link
@craigcitro

craigcitro Jan 29, 2016

Collaborator

identifier.

This comment has been minimized.

Copy link
@krlmlr

krlmlr Jan 29, 2016

Author Member

There's usually no full stop in the caption of a function's documentation; I'll write a description for this function.

#' @return a character.
#' @family identifier functions
#' @export
format_dataset <- function(project_id, dataset) {

This comment has been minimized.

Copy link
@craigcitro

craigcitro Jan 29, 2016

Collaborator

should we tweak the args here, so that

do.call(format_dataset, parse_dataset(...)) == ...

This comment has been minimized.

Copy link
@krlmlr

krlmlr Jan 29, 2016

Author Member

I don't know, it's inconsistent all over the place: projectId vs. project vs. project_id. The first is required by the API, I guess, but we should be consistent at least throughout the bigrquery interface. I can change this instance, but there are a few others, most notably in jobs.R and tables.R.

This comment has been minimized.

Copy link
@krlmlr

krlmlr Jan 29, 2016

Author Member

It's dataset, too. I'd like to keep the naming for this PR (so that it's consistent with the parse_() functions) and handle this issue elsewhere (#85).

#' \code{table_id} components (any of which may be \code{NULL}).
#' @family identifier functions
#' @export
parse_table <- function(table, project_id = NULL) {

This comment has been minimized.

Copy link
@craigcitro

craigcitro Jan 29, 2016

Collaborator

it's strange that i apparently didn't add a dataset_id and use it if necessary. seems like it'd be worth adding?

This comment has been minimized.

Copy link
@krlmlr

krlmlr Jan 29, 2016

Author Member

#84

@craigcitro

This comment has been minimized.

Copy link
Collaborator

commented Jan 29, 2016

LGTM to me modulo comments above.

totally fine with moving these all out of utils.R.

@krlmlr

This comment has been minimized.

Copy link
Member Author

commented Jan 29, 2016

Addressed your comments and added tests.

Kirill Müller added some commits Jan 29, 2016

Kirill Müller
add .gitattributes
for painless merging of NEWS.md
@craigcitro

This comment has been minimized.

Copy link
Collaborator

commented Jan 29, 2016

LGTM, happy to resolve the other bits separately

craigcitro added a commit that referenced this pull request Jan 29, 2016

Merge pull request #81 from krlmlr/feature/format
New format_dataset() and format_table()

@craigcitro craigcitro merged commit 806dd83 into r-dbi:master Jan 29, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@krlmlr krlmlr deleted the krlmlr:feature/format branch Jan 29, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.