Skip to content

Commit 7d40eb7

Browse files
authored
bugfix: make sure file copy runs after the file handle is closed and the buffer is flushed (#1008)
1 parent ad78273 commit 7d40eb7

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

v03_pipeline/lib/reference_datasets/clinvar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def get_ht(
168168
delete=False,
169169
) as tmp_file, requests.get(clinvar_url, stream=True, timeout=10) as r:
170170
shutil.copyfileobj(r.raw, tmp_file)
171-
cloud_tmp_file = copy_to_cloud_storage(tmp_file.name)
171+
cloud_tmp_file = copy_to_cloud_storage(tmp_file.name)
172172
ht = vcf_to_ht(cloud_tmp_file, reference_genome)
173173
# Filter deletions present as single alleles
174174
ht = ht.filter(hl.len(ht.alleles) == BIALLELIC)

v03_pipeline/lib/reference_datasets/misc.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,4 @@ def copy_to_cloud_storage(file_name: str) -> str:
180180
else:
181181
cloud_storage_path = os.path.join(Env.HAIL_TMP_DIR, os.path.basename(file_name))
182182
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)
186183
return cloud_storage_path

0 commit comments

Comments
 (0)