Skip to content

Commit

Permalink
Update hydromt/data_adapter/dataframe.py
Browse files Browse the repository at this point in the history
Co-authored-by: DirkEilander <[email protected]>
  • Loading branch information
savente93 and DirkEilander authored Jul 31, 2023
1 parent 7f0a534 commit f194905
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hydromt/data_adapter/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,13 @@ def to_file(
logger.warning(str(err))
return None, None, None

read_kwargs = dict()
if driver is None or driver == "csv":
# always write as CSV
driver = "csv"
fn_out = join(data_root, f"{data_name}.csv")
obj.to_csv(fn_out, **kwargs)
kwargs["index_col"] = obj.index.name
read_kwargs["index_col"] = obj.index.name
elif driver == "parquet":
fn_out = join(data_root, f"{data_name}.parquet")
obj.to_parquet(fn_out, **kwargs)
Expand Down

0 comments on commit f194905

Please sign in to comment.