Skip to content

Commit b41593b

Browse files
committed
Enable saving on specified dest
1 parent 156e1a3 commit b41593b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

dms_datastore/dropbox_data.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@ def get_data(spec):
116116

117117
item = listing["collect"]
118118
metadata = listing["metadata"]
119+
dest = listing["dest"]
119120

121+
if not os.path.exists(dest):
122+
raise ValueError(f"Destination {dest} does not exist.")
120123

121124
file_pattern = item["file_pattern"].format(dropbox_home=dropbox_home)
122125
location = item["location"].format(dropbox_home=dropbox_home)
@@ -159,7 +162,7 @@ def get_data(spec):
159162
fname_out = (meta_out["source"] + "_" + meta_out["station_id"]
160163
+ "_" + meta_out["agency_id"] + "_" + meta_out["param"] + ".csv")
161164

162-
fname_out = os.path.join("formatted", fname_out)
165+
fname_out = os.path.join(dest, fname_out)
163166
print(fname_out)
164167
write_ts_csv(ts, fname_out, meta_out, chunk_years=True)
165168

0 commit comments

Comments
 (0)