Skip to content

Commit

Permalink
Merge pull request #34 from svenkreiss/saveastextfile-encoding
Browse files Browse the repository at this point in the history
use .format() instead of str()
  • Loading branch information
svenkreiss committed Mar 1, 2016
2 parents bd21840 + aa38ef4 commit 6f0cacd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pysparkling/rdd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1383,7 +1383,7 @@ def saveAsTextFile(self, path, compressionCodecClass=None):
fileio.TextFile(
path
).dump(io.StringIO(''.join([
str(xx)+'\n' for xx in self.toLocalIterator()
'{}\n'.format(xx) for xx in self.toLocalIterator()
])))
return self

Expand All @@ -1393,7 +1393,7 @@ def saveAsTextFile(self, path, compressionCodecClass=None):
os.path.join(path, 'part-{0:05d}{1}'.format(tc.partitionId(),
codec_suffix))
).dump(io.StringIO(''.join([
str(xx)+'\n' for xx in x
'{}\n'.format(xx) for xx in x
]))),
resultHandler=list,
)
Expand Down

0 comments on commit 6f0cacd

Please sign in to comment.