Skip to content

Commit

Permalink
few changes
Browse files Browse the repository at this point in the history
- pure set logic for shared_fields/ref_fields in to_dense_mt/coalesce_join
- annotate the call_field from ref_call_field rather than transmute it,
  since both 'ref_call_field' and 'call_field' might still be in the
  variant data
  • Loading branch information
chrisvittal committed May 24, 2024
1 parent e8a4c2d commit b8e2dc3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions hail/python/hail/vds/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ def coalesce_join(ref, var):
if ref_call_field not in ref:
ref = ref.annotate(**{call_field: hl.call(0, 0)})
else:
ref = ref.transmute(**{call_field: ref[ref_call_field]})
ref = ref.annotate(**{call_field: ref[ref_call_field]})

# call_field is now in both ref and var
shared_fields = set(f for f in ref.dtype if f in var.dtype)
var_fields = set(var.dtype) - shared_fields
ref_set, var_set = set(ref.dtype), set(var.dtype)
shared_fields = var_set & ref_set
var_fields = var_set - ref_set

return hl.if_else(
hl.is_defined(var),
Expand Down

0 comments on commit b8e2dc3

Please sign in to comment.