Skip to content

Commit

Permalink
Flush the underlying file-like object.
Browse files Browse the repository at this point in the history
  • Loading branch information
shunping committed Sep 17, 2024
1 parent 8088ecf commit ec37750
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sdks/python/apache_beam/dataframe/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ def _read(self, size=-1):
return res

def flush(self):
return
self._underlying.flush()


class _ReadFromPandasDoFn(beam.DoFn, beam.RestrictionProvider):
Expand Down
6 changes: 3 additions & 3 deletions sdks/python/apache_beam/io/textio_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1737,8 +1737,8 @@ def test_non_utf8_csv_read_write(self):
with TestPipeline() as p:
r1 = (
p
| beam.io.ReadFromCsv(input_fn, encoding="latin1")
| beam.Map(lambda x: x._asdict()))
| 'Read' >> beam.io.ReadFromCsv(input_fn, encoding="latin1")
| 'ToDict' >> beam.Map(lambda x: x._asdict()))
assert_that(
r1,
equal_to([{
Expand All @@ -1750,7 +1750,7 @@ def test_non_utf8_csv_read_write(self):
with TestPipeline() as p:
_ = (
p
| beam.io.ReadFromCsv(input_fn, encoding="latin1")
| 'Read' >> beam.io.ReadFromCsv(input_fn, encoding="latin1")
| 'Write' >> beam.io.WriteToCsv(
os.path.join(dest, 'out'), encoding="latin1"))

Expand Down

0 comments on commit ec37750

Please sign in to comment.