Skip to content

Commit

Permalink
Update to_csv function
Browse files Browse the repository at this point in the history
  • Loading branch information
FavioVazquez committed Oct 9, 2017
1 parent a8113e4 commit dfff7c6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions optimus/df_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1162,10 +1162,10 @@ def write_df_as_json(self, path):
# outfile.write(str(json_cols).replace("'", "\""))
outfile.write(p)

def to_csv(self, path, header=True, mode="overwrite", sep=",", *args, **kargs):
def to_csv(self, path_name, header=True, mode="overwrite", sep=",", *args, **kargs):
"""
Write dataframe as CSV.
:param path: Path to write the DF.
:param path_name: Path to write the DF and the name of the output CSV file.
:param header: True or False to include header
:param mode: Specifies the behavior of the save operation when data already exists.
"append": Append contents of this DataFrame to existing data.
Expand All @@ -1177,4 +1177,4 @@ def to_csv(self, path, header=True, mode="overwrite", sep=",", *args, **kargs):
:return: Dataframe in a CSV format in the specified path.
"""

return self._df.write.options(header).mode(mode).csv(path, sep=sep, *args, **kargs)
return self._df.write.options(header).mode(mode).csv(path_name, sep=sep, *args, **kargs)

0 comments on commit dfff7c6

Please sign in to comment.