Skip to content

Commit 022999a

Browse files
vlasenkoalexeyyongtang
authored andcommitted
Patching 0.7.1 release (#639)
* making sure that bigquery reader is returning meaningfull defaults for null values (#626) * making sure that bigquery reader is returning meaningfull defaults for null values * linter fixes * Use balanced sharding strategy in bigquery read session. (#601) We use sharding to provide a way of shuffling the read order. With liquid sharding, a single stream can read all data which wouldn't be shuffled. * bumping release version 0.7.1->0.7.2 * properly merging tensorflow_io/bigquery/kernels/bigquery_lib.h
1 parent 18b113d commit 022999a

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def has_ext_modules(self):
9595
"""
9696

9797
package = 'tensorflow>=1.14.0,<1.15.0'
98-
version = '0.7.1'
98+
version = '0.7.2'
9999
project = 'tensorflow-io'
100100
if '--package-version' in sys.argv:
101101
print(package)

tensorflow_io/bigquery/kernels/bigquery_kernels.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ class BigQueryReadSessionOp : public OpKernel {
149149
createReadSessionRequest.mutable_read_options()->set_row_restriction(
150150
row_restriction_);
151151
createReadSessionRequest.set_requested_streams(requested_streams_);
152+
createReadSessionRequest.set_sharding_strategy(apiv1beta1::ShardingStrategy::BALANCED);
152153
createReadSessionRequest.set_format(apiv1beta1::DataFormat::AVRO);
153154
VLOG(3) << "createReadSessionRequest: "
154155
<< createReadSessionRequest.DebugString();

tensorflow_io/bigquery/kernels/bigquery_lib.h

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,31 @@ class BigQueryReaderDatasetIterator : public DatasetIterator<Dataset> {
253253
((*out_tensors)[i]).scalar<string>()() =
254254
field.value<avro::GenericEnum>().symbol();
255255
break;
256-
case avro::AVRO_NULL: // Fallthrough;
256+
case avro::AVRO_NULL:
257+
switch(output_types[i]) {
258+
case DT_BOOL:
259+
((*out_tensors)[i]).scalar<bool>()() = false;
260+
break;
261+
case DT_INT32:
262+
((*out_tensors)[i]).scalar<int32>()() = 0;
263+
break;
264+
case DT_INT64:
265+
((*out_tensors)[i]).scalar<int64>()() = 0l;
266+
break;
267+
case DT_FLOAT:
268+
((*out_tensors)[i]).scalar<float>()() = 0.0f;
269+
break;
270+
case DT_DOUBLE:
271+
((*out_tensors)[i]).scalar<double>()() = 0.0;
272+
break;
273+
case DT_STRING:
274+
((*out_tensors)[i]).scalar<string>()() = "";
275+
break;
276+
default:
277+
return errors::InvalidArgument(
278+
"unsupported data type against AVRO_NULL: ",
279+
output_types[i]);
280+
}
257281
break;
258282
default:
259283
return errors::InvalidArgument("unsupported data type: ",

0 commit comments

Comments
 (0)