ahmedabu98 opened a new pull request, #26201:
URL: https://github.com/apache/beam/pull/26201
Textio documentation states that only `UTF-8` and `ASCII` encodings are
supported. This is not true because a coder with custom encoding can be passed
in and used to decode the text.
Example:
```
class VariableCodecCoder(Coder):
def __init__(self, codec):
self._codec = codec
def encode(self, value):
return value.encode(self._codec)
def decode(self, value):
return value.decode(self._codec)
def is_deterministic(self):
return True
def to_type_hint(self):
return str
with beam.Pipeline() as p:
(
p
| beam.io.ReadFromText("a", coder = VariableCodecCoder('cp864'))
| beam.Map(print)
)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]