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

return empty data frame (instead of NULL) for zero-row result #88

Merged
merged 7 commits into from Feb 10, 2016

Conversation

@krlmlr
Copy link
Member

commented Feb 5, 2016

implemented by generating a one-row data frame full of NA values and then chopping off that one row

Kirill Müller added some commits Feb 5, 2016

Kirill Müller
@craigcitro

This comment has been minimized.

Copy link
Collaborator

commented Feb 5, 2016

LGTM -- is this easy enough to add a test for?

@krlmlr

This comment has been minimized.

Copy link
Member Author

commented Feb 5, 2016

Will be tested implicitly with one of the DBItest tests. I'm not looking into Travis testing just yet -- this requires setting up an OAuth token that can be used by Travis (#14).

@krlmlr

This comment has been minimized.

Copy link
Member Author

commented Feb 8, 2016

Merged with master.

Kirill Müller added some commits Feb 8, 2016

dummy_rows <- list(list(f = rep(list(NULL), length(schema$fields))))

data <- extract_data(dummy_rows, schema)
return(data[integer(), , drop = FALSE])

This comment has been minimized.

Copy link
@hadley

hadley Feb 10, 2016

Member

I think data[0, , drop = FALSE] is a more idiomatic way of doing this

Kirill Müller

hadley added a commit that referenced this pull request Feb 10, 2016

Merge pull request #88 from krlmlr/feature/empty-df
return empty data frame (instead of NULL) for zero-row result

@hadley hadley merged commit 94e5c3b into r-dbi:master Feb 10, 2016

1 check passed

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

@krlmlr krlmlr deleted the krlmlr:feature/empty-df branch Feb 11, 2016

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