Skip to content

GH-36714: [R] Create user-friendly wrappers around existing S3 functionality - #36851

Closed
thisisnic wants to merge 13 commits into
apache:mainfrom
thisisnic:GH-36714_s3_wrappers
Closed

thisisnic wants to merge 13 commits into
apache:mainfrom
thisisnic:GH-36714_s3_wrappers

Conversation

@thisisnic

@thisisnic thisisnic commented Jul 24, 2023 •

Copy link
Copy Markdown
Member

Rationale for this change

Add wrapper functions to our

What changes are included in this PR?

Add the following functions:

TODO:

  • tests

  • implement close.OutputStream() as a wrapper around the close() method

  • update the docs to reflect the new functions

Are these changes tested?

Are there any user-facing changes?

@thisisnic

Copy link
Copy Markdown
Member Author

This may need a rethink; while the original intent was to mirror the fs API, given we have different parameters for the functions here and want to just create thin wrappers to the Arrow Filesystem API instead of the extra work of mapping functions to their equivalents, perhaps the differences could create confusion and we'd be better off with our own API instead?

Perhaps for simplicity we just mirror the Arrow C++ API names, e.g. the wrapper for bucket$GetFileInfo(paths) is just called fs_get_file_info(). We still have the acronym "fs" there, but I think that's reasonable given it's short for FileSystem and is distinct from the fs package API.

Comment thread r/R/filesystem.R Outdated
Comment on lines +708 to +716
fs_open_output_stream <- function(fs, path, append = FALSE){
if (append) {
fs$OpenAppendStream(path)
} else {
fs$OpenOutputStream(path)
}
}

# TODO: create method close.OutputStream (or whatever object returned from bucket$OpenAppendStream)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work and is mixing approaches

@thisisnic

Copy link
Copy Markdown
Member Author

Closing this as this isn't a great solution as it'd complicate our API

@thisisnic thisisnic closed this Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[R] Create user-friendly wrappers around existing S3 functionality

1 participant