Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion tensorflow_io/core/plugins/file_system_plugins.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,25 @@ void TF_InitPlugin(TF_FilesystemPluginInfo* info) {
sizeof(info->ops[0])));
tensorflow::io::az::ProvideFilesystemSupportFor(&info->ops[0], "az");
tensorflow::io::http::ProvideFilesystemSupportFor(&info->ops[1], "http");
tensorflow::io::s3::ProvideFilesystemSupportFor(&info->ops[2], "s3e");
if (enable_legacy == "true" || enable_legacy == "1") {
// TODO: enable on windows once tf-nightly releases windows build
// that contains TF_ENABLE_LEGACY_FILESYSTEM.
#if defined(_MSC_VER)
tensorflow::io::s3::ProvideFilesystemSupportFor(&info->ops[2], "s3");
#else
tensorflow::io::s3::ProvideFilesystemSupportFor(&info->ops[2], "s3e");
#endif
tensorflow::io::hdfs::ProvideFilesystemSupportFor(&info->ops[3], "hdfse");
tensorflow::io::hdfs::ProvideFilesystemSupportFor(&info->ops[4], "viewfse");
tensorflow::io::hdfs::ProvideFilesystemSupportFor(&info->ops[5], "hare");
} else {
// TODO: enable on windows once tf-nightly releases windows build
// that contains TF_ENABLE_LEGACY_FILESYSTEM.
#if defined(_MSC_VER)
tensorflow::io::s3::ProvideFilesystemSupportFor(&info->ops[2], "s3e");
#else
tensorflow::io::s3::ProvideFilesystemSupportFor(&info->ops[2], "s3");
#endif
tensorflow::io::hdfs::ProvideFilesystemSupportFor(&info->ops[3], "hdfs");
tensorflow::io::hdfs::ProvideFilesystemSupportFor(&info->ops[4], "viewfs");
tensorflow::io::hdfs::ProvideFilesystemSupportFor(&info->ops[5], "har");
Expand Down
4 changes: 1 addition & 3 deletions tests/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,5 @@ def test_read_file():
os.environ["S3_USE_HTTPS"] = "0"
os.environ["S3_VERIFY_SSL"] = "0"

# TODO: The following is not working yet, need update to use
# s3 implementation with module file system
content = tf.io.read_file("s3e://{}/{}".format(bucket_name, key_name))
content = tf.io.read_file("s3://{}/{}".format(bucket_name, key_name))
assert content == body