Skip to content

Commit 8641f00

Browse files
committed
i guess this is necessary
1 parent 0780de5 commit 8641f00

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

v03_pipeline/lib/misc/family_entries.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,18 @@ def remove_family_guids(
9898
family_guids: hl.SetExpression,
9999
) -> hl.Table:
100100
# Remove families from the existing project table structure (both the entries arrays and the globals are mutated)
101-
family_indexes_to_keep = hl.array(
101+
family_indexes_to_keep = hl.eval(hl.array(
102102
hl.enumerate(ht.globals.family_guids)
103103
.filter(lambda item: ~family_guids.contains(item[1]))
104104
.map(lambda item: item[0]),
105-
)
105+
))
106106
ht = ht.annotate(
107-
family_entries=family_indexes_to_keep.map(lambda i: ht.family_entries[i]),
107+
# NB: this "should" work without the extra if statement (and does in the tests)
108+
# however, experiments on dataproc showed this statement hanging with an empty
109+
# indexes array.
110+
family_entries=family_indexes_to_keep.map(lambda i: ht.family_entries[i])
111+
if len(family_indexes_to_keep) > 0
112+
else hl.empty_array(ht.family_entries.dtype.element_type)
108113
)
109114
return ht.annotate_globals(
110115
family_guids=ht.family_guids.filter(

v03_pipeline/lib/misc/lookup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,10 @@ def remove_project(
135135
)
136136
ht = ht.annotate(
137137
project_stats=(
138-
project_indexes_to_keep.map(
139-
lambda i: ht.project_stats[i],
140-
)
138+
# See "remove_family_guids" func for why this was necessary
139+
project_stats=project_indexes_to_keep.map(lambda i: ht.project_stats[i])
140+
if len(project_indexes_to_keep) > 0
141+
else hl.empty_array(ht.project_stats.dtype.element_type)
141142
),
142143
)
143144
ht = ht.filter(hl.any(ht.project_stats.map(hl.is_defined)))

0 commit comments

Comments
 (0)