We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following python code can be used to reproduce the problem.
"""Show an error when reading a non-utf8 encoding file with ReadFromCSV.""" import tempfile import apache_beam as beam from apache_beam.pipeline import Pipeline from apache_beam.options.pipeline_options import PipelineOptions from apache_beam.io import ReadFromCsv def _run(): content = b"\xe0,\xe1,\xe2\n0,1,2\n1,2,3\n2,3,4\n3,4,5\n4,5,6\n5,6,7\n" \ b"6,7,8\n7,8,9\n8,9,0\n9,0,1\n0,1,2\n1,2,3\n" with tempfile.NamedTemporaryFile(suffix=".csv") as fp: input_fn = fp.name print(input_fn) with open(input_fn, 'wb') as f: f.write(content) pipeline_options = PipelineOptions() with Pipeline(options=pipeline_options) as p: _ = ( p | 'Read' >> ReadFromCsv(input_fn, encoding="latin1") | 'CheckBytes' >> beam.Map(lambda x: print(x)) ) if __name__ == "__main__": _run()
The error message is like UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 0: unexpected end of data.
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 0: unexpected end of data
Priority: 2 (default / most bugs should be filed as P2)
The text was updated successfully, but these errors were encountered:
.take-issue
Sorry, something went wrong.
shunping
Successfully merging a pull request may close this issue.
What happened?
The following python code can be used to reproduce the problem.
The error message is like
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 0: unexpected end of data
.Issue Priority
Priority: 2 (default / most bugs should be filed as P2)
Issue Components
The text was updated successfully, but these errors were encountered: