Skip to content

Commit f6df6fc

Browse files
Fix parse_avro docstring so that it can be shown in API doc (#1034)
* Fix the docstring so that it can be shown in API doc * update stringdoc Co-authored-by: Cheng Ren <1428327+chengren311@users.noreply.github.com>
1 parent fd8776d commit f6df6fc

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

tensorflow_io/core/python/experimental/parse_avro_ops.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,6 @@ def parse_avro(serialized, reader_schema, features, avro_names=None, name=None):
3131
"""
3232
Parses `avro` records into a `dict` of tensors.
3333
34-
:param serialized: The batched, serialized string tensors.
35-
:param reader_schema: The reader schema. Note, this MUST match the reader
36-
schema from the avro_record_dataset. Otherwise,
37-
this op will segfault!
38-
:param features: A map of feature names mapped to feature
39-
information.
40-
:param avro_names: (Optional.) may contain descriptive names
41-
for the corresponding serialized avro parts. These may
42-
be useful for debugging purposes, but they have no
43-
effect on the output. If not `None`, `avro_names`
44-
must be the same length as `serialized`.
45-
46-
:param name: The name of the op.
47-
48-
:return: A map of feature names to tensors.
49-
5034
This op parses serialized avro records into a dictionary mapping keys to
5135
`Tensor`, and `SparseTensor` objects. `features` is a dict from keys to
5236
`VarLenFeature`, `SparseFeature`, `RaggedFeature`, and `FixedLenFeature`
@@ -79,6 +63,24 @@ def parse_avro(serialized, reader_schema, features, avro_names=None, name=None):
7963
Use this within the dataset.map(parser_fn=parse_avro).
8064
8165
Only works for batched serialized input!
66+
67+
Args:
68+
serialized: The batched, serialized string tensors.
69+
70+
reader_schema: The reader schema. Note, this MUST match the reader schema
71+
from the avro_record_dataset. Otherwise, this op will segfault!
72+
73+
features: A map of feature names mapped to feature information.
74+
75+
avro_names: (Optional.) may contain descriptive names for the
76+
corresponding serialized avro parts. These may be useful for debugging
77+
purposes, but they have no effect on the output. If not `None`,
78+
`avro_names` must be the same length as `serialized`.
79+
80+
name: The name of the op.
81+
82+
Returns:
83+
A map of feature names to tensors.
8284
"""
8385
if not features:
8486
raise ValueError("Missing: features was %s." % features)

0 commit comments

Comments
 (0)