Skip to content

Commit

Permalink
Rename the file_name parameter to filepath parameter in ExcelHandler (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
lajohn4747 committed Jun 28, 2024
1 parent 5ba0c77 commit 3cbcb47
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sdv/io/local/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,14 @@ def read(self, filepath, sheet_names=None):

return self._read_excel(filepath, sheet_names)

def write(self, synthetic_data, file_name, sheet_name_suffix=None, mode='w'):
def write(self, synthetic_data, filepath, sheet_name_suffix=None, mode='w'):
"""Write synthetic data to an Excel File.
Args:
synthetic_data (dict):
A dictionary mapping table names to pandas DataFrames containing synthetic data.
file_name (str):
The name of the Excel file to write.
filepath (str):
The path to the Excel file to write.
sheet_name_suffix (str, optional):
A suffix to add to each sheet name.
mode (str, optional):
Expand All @@ -243,7 +243,7 @@ def write(self, synthetic_data, file_name, sheet_name_suffix=None, mode='w'):
suffix_added = False

if mode == 'a':
temp_data = self._read_excel(file_name)
temp_data = self._read_excel(filepath)
for table_name, table in synthetic_data.items():
sheet_name = table_name
if sheet_name_suffix:
Expand All @@ -258,7 +258,7 @@ def write(self, synthetic_data, file_name, sheet_name_suffix=None, mode='w'):
else:
temp_data[sheet_name] = table

writer = pd.ExcelWriter(file_name)
writer = pd.ExcelWriter(filepath)
for table_name, table_data in temp_data.items():
if sheet_name_suffix and not suffix_added:
table_name += sheet_name_suffix
Expand Down

0 comments on commit 3cbcb47

Please sign in to comment.