-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
tiffanychu90
committed
Oct 13, 2023
1 parent
0c0b611
commit d740d35
Showing
2 changed files
with
29 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
""" | ||
Remove staged files. | ||
Do this in a separate script in case we don't want to run. | ||
""" | ||
import gcsfs | ||
|
||
fs = gcsfs.GCSFileSystem() | ||
|
||
def if_exists_then_delete(filepath): | ||
if fs.exists(filepath): | ||
if fs.isdir(filepath): | ||
fs.rm(filepath, recursive=True) | ||
else: | ||
fs.rm(filepath) | ||
|
||
return | ||
|
||
|
||
if __name__ == "__main__": | ||
|
||
from update_vars import analysis_date_list, CONFIG_DICT | ||
|
||
for analysis_date in analysis_date_list: | ||
|
||
INPUT_FILE = CONFIG_DICT["usable_vp_file"] | ||
if_exists_then_delete(f"{SEGMENT_GCS}{INPUT_FILE}_{analysis_date}_stage") | ||
if_exists_then_delete(f"{SEGMENT_GCS}vp_direction_{analysis_date}.parquet") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters