File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
v03_pipeline/lib/reference_datasets Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -176,8 +176,11 @@ def copy_to_cloud_storage(file_name: str) -> str:
176
176
if not Env .HAIL_TMP_DIR .startswith ('gs://' ):
177
177
return file_name
178
178
if os .path .isdir (file_name ):
179
- path = os .path .join (Env .HAIL_TMP_DIR , file_name .lstrip ('/' ))
179
+ cloud_storage_path = os .path .join (Env .HAIL_TMP_DIR , file_name .lstrip ('/' ))
180
180
else :
181
- path = os .path .join (Env .HAIL_TMP_DIR , os .path .basename (file_name ))
182
- hfs .copy (file_name , path )
183
- return path
181
+ cloud_storage_path = os .path .join (Env .HAIL_TMP_DIR , os .path .basename (file_name ))
182
+ hfs .copy (file_name , cloud_storage_path )
183
+ if os .path .getsize (file_name ) != hfs .stat (cloud_storage_path ).size :
184
+ msg = 'Local and Cloud storage file sizes differ'
185
+ raise AssertionError (msg )
186
+ return cloud_storage_path
You can’t perform that action at this time.
0 commit comments