Skip to content

Commit 3111093

Browse files
author
srikris
committed
Merge branch 'master' into gl-pickle-extensibility
2 parents 9ea9262 + 0e13815 commit 3111093

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

oss_src/fileio/union_fstream.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ union_fstream::union_fstream(std::string url,
6868
input_stream = (*cachestream)->get_underlying_stream();
6969
if (input_stream == nullptr) input_stream = cachestream;
7070
m_file_size = (*cachestream)->file_size();
71+
original_input_stream_handle = std::static_pointer_cast<std::istream>(cachestream);
7172
}
7273
} else if (boost::starts_with(url, "s3://")) {
7374
// the S3 file type currently works by download/uploading a local file
@@ -80,6 +81,7 @@ union_fstream::union_fstream(std::string url,
8081
input_stream = (*s3stream)->get_underlying_stream();
8182
if (input_stream == nullptr) input_stream = s3stream;
8283
m_file_size = (*s3stream)->file_size();
84+
original_input_stream_handle = std::static_pointer_cast<std::istream>(s3stream);
8385
}
8486
} else {
8587
// must be local file

oss_src/fileio/union_fstream.hpp

+3
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ class union_fstream {
6666

6767
std::shared_ptr<std::istream> input_stream;
6868
std::shared_ptr<std::ostream> output_stream;
69+
70+
// Hold the input stream from cache or s3 stream.
71+
std::shared_ptr<std::istream> original_input_stream_handle;
6972
};
7073

7174
} // namespace graphlab

oss_src/unity/python/sframe/test/test_sframe.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1151,8 +1151,8 @@ def test_min_max_with_missing_values(self):
11511151
self.assertEqual(sf2['Var of value'], [1, 0])
11521152
self.assertEqual(sf2['Stdv of value'], [1, 0])
11531153
self.assertEqual(sf2['Count Distinct of value'], [2, 1])
1154-
self.assertEqual(sorted(sf2['Distinct of value'][0]), sorted([1, None]))
1155-
self.assertEqual(sorted(sf2['Distinct of value'][1]), sorted([None]))
1154+
self.assertEqual(set(sf2['Distinct of value'][0]), set([1, None]))
1155+
self.assertEqual(set(sf2['Distinct of value'][1]), set([None]))
11561156
self.assertEqual(sf2['Frequency Count of value'][0], {1:1, None:5})
11571157
self.assertEqual(sf2['Frequency Count of value'][1], {None:4})
11581158

0 commit comments

Comments
 (0)