Skip to content

Commit

Permalink
Remove warning in dataframes io. (#29084)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertwb authored Oct 20, 2023
1 parent 641b95d commit 7610d46
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sdks/python/apache_beam/dataframe/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,9 @@ def expand(self, root):
if not self.binary:
handle = TextIOWrapper(handle)
if self.incremental:
sample = next(
self.reader(handle, *self.args, **dict(self.kwargs, chunksize=100)))
with self.reader(handle, *self.args, **dict(self.kwargs,
chunksize=100)) as stream:
sample = next(stream)
else:
sample = self.reader(handle, *self.args, **self.kwargs)

Expand Down

0 comments on commit 7610d46

Please sign in to comment.