Error summary: IllegalArgumentException: requirement failed

Hi Hail Team,

I am running the following code:
print(“Perform sample QC on autosomes”)
lcr_intervals = hl.import_locus_intervals(lcr)
lcr_filtered = vcf_mt.filter_rows(
# remove filtered variants, LCR variants, and ChrX variants
((vcf_mt.filters.length() > 0) | (hl.is_defined(lcr_intervals[vcf_mt.locus])) | (vcf_mt.locus.contig == ‘chrX’)),
keep=False
)

summary.append((‘LCRPruned’, lcr_filtered))
print(“Exporting Sample QC stats for LCR-pruned variants”)
sample_df = hl.sample_qc(lcr_filtered, name=‘sqc’)
sample_df=sample_df.cols().to_pandas()

However, I got an error message like this:


FatalError Traceback (most recent call last)
/tmp/ipykernel_80073/2129889008.py in
3 # export sample statistics considering LCR filtered variants
4 sample_df = hl.sample_qc(lcr_filtered, name=‘sqc’)
----> 5 sample_df=sample_df.cols().to_pandas()
6
7 # .cols().to_pandas().rename(

in to_pandas(self, flatten)

~/.conda/envs/myconda_env/lib/python3.7/site-packages/hail/typecheck/check.py in wrapper(__original_func, *args, **kwargs)
575 def wrapper(original_func, *args, **kwargs):
576 args
, kwargs
= check_all(__original_func, args, kwargs, checkers, is_method=is_method)
→ 577 return original_func(*args, **kwargs)
578
579 return wrapper

~/.conda/envs/myconda_env/lib/python3.7/site-packages/hail/table.py in to_pandas(self, flatten)
3255 dtypes_struct = table.row.dtype
3256 collect_dict = {key: hl.agg.collect(value) for key, value in table.row.items()}
→ 3257 column_struct_array = table.aggregate(hl.struct(**collect_dict))
3258 columns = list(column_struct_array.keys())
3259 data_dict = {}

in aggregate(self, expr, _localize)

~/.conda/envs/myconda_env/lib/python3.7/site-packages/hail/typecheck/check.py in wrapper(__original_func, *args, **kwargs)
575 def wrapper(original_func, *args, **kwargs):
576 args
, kwargs
= check_all(__original_func, args, kwargs, checkers, is_method=is_method)
→ 577 return original_func(*args, **kwargs)
578
579 return wrapper

~/.conda/envs/myconda_env/lib/python3.7/site-packages/hail/table.py in aggregate(self, expr, _localize)
1176
1177 if _localize:
→ 1178 return Env.backend().execute(hl.ir.MakeTuple([agg_ir]))[0]
1179
1180 return construct_expr(ir.LiftMeOut(agg_ir), expr.dtype)

~/.conda/envs/myconda_env/lib/python3.7/site-packages/hail/backend/py4j_backend.py in execute(self, ir, timed)
108 raise HailUserError(message_and_trace) from None
109
→ 110 raise e

~/.conda/envs/myconda_env/lib/python3.7/site-packages/hail/backend/py4j_backend.py in execute(self, ir, timed)
84 # print(self._hail_package.expr.ir.Pretty.apply(jir, True, -1))
85 try:
—> 86 result_tuple = self._jhc.backend().executeEncode(jir, stream_codec)
87 (result, timings) = (result_tuple._1(), result_tuple._2())
88 value = ir.typ._from_encoding(result)

~/.conda/envs/myconda_env/lib/python3.7/site-packages/py4j/java_gateway.py in call(self, *args)
1303 answer = self.gateway_client.send_command(command)
1304 return_value = get_return_value(
→ 1305 answer, self.gateway_client, self.target_id, self.name)
1306
1307 for temp_arg in temp_args:

~/.conda/envs/myconda_env/lib/python3.7/site-packages/hail/backend/py4j_backend.py in deco(*args, **kwargs)
29 raise FatalError(’%s\n\nJava stack trace:\n%s\n’
30 ‘Hail version: %s\n’
—> 31 ‘Error summary: %s’ % (deepest, full, hail.version, deepest), error_id) from None
32 except pyspark.sql.utils.CapturedException as e:
33 raise FatalError(’%s\n\nJava stack trace:\n%s\n’

FatalError: IllegalArgumentException: requirement failed

Java stack trace:
java.lang.IllegalArgumentException: requirement failed
at scala.Predef$.require(Predef.scala:268)
at is.hail.rvd.RVDPartitioner.(RVDPartitioner.scala:52)
at is.hail.rvd.RVDPartitioner.extendKeySamePartitions(RVDPartitioner.scala:141)
at is.hail.expr.ir.LoweredTableReader$$anon$2.coerce(TableIR.scala:382)
at is.hail.expr.ir.GenericTableValue.toTableStage(GenericTableValue.scala:162)
at is.hail.io.vcf.MatrixVCFReader.lower(LoadVCF.scala:1790)
at is.hail.expr.ir.lowering.LowerTableIR$.applyTable(LowerTableIR.scala:581)
at is.hail.expr.ir.lowering.LowerTableIR$.lower$2(LowerTableIR.scala:561)
at is.hail.expr.ir.lowering.LowerTableIR$.applyTable(LowerTableIR.scala:1308)
at is.hail.expr.ir.lowering.LowerTableIR$.lower$2(LowerTableIR.scala:561)
at is.hail.expr.ir.lowering.LowerTableIR$.applyTable(LowerTableIR.scala:1279)
at is.hail.expr.ir.lowering.LowerTableIR$.lower$2(LowerTableIR.scala:561)
at is.hail.expr.ir.lowering.LowerTableIR$.applyTable(LowerTableIR.scala:1035)
at is.hail.expr.ir.lowering.LowerTableIR$.lower$2(LowerTableIR.scala:561)
at is.hail.expr.ir.lowering.LowerTableIR$.applyTable(LowerTableIR.scala:653)
at is.hail.expr.ir.lowering.LowerTableIR$.lower$1(LowerTableIR.scala:394)
at is.hail.expr.ir.lowering.LowerTableIR$.apply(LowerTableIR.scala:420)
at is.hail.expr.ir.lowering.LowerToCDA$.lower(LowerToCDA.scala:69)
at is.hail.expr.ir.lowering.LowerToCDA$.apply(LowerToCDA.scala:18)
at is.hail.expr.ir.lowering.LowerToDistributedArrayPass.transform(LoweringPass.scala:77)
at is.hail.expr.ir.LowerOrInterpretNonCompilable$.evaluate$1(LowerOrInterpretNonCompilable.scala:27)
at is.hail.expr.ir.LowerOrInterpretNonCompilable$.rewrite$1(LowerOrInterpretNonCompilable.scala:67)
at is.hail.expr.ir.LowerOrInterpretNonCompilable$.rewrite$1(LowerOrInterpretNonCompilable.scala:53)
at is.hail.expr.ir.LowerOrInterpretNonCompilable$.apply(LowerOrInterpretNonCompilable.scala:72)
at is.hail.expr.ir.lowering.LowerOrInterpretNonCompilablePass$.transform(LoweringPass.scala:69)
at is.hail.expr.ir.lowering.LoweringPass.$anonfun$apply$3(LoweringPass.scala:16)
at is.hail.utils.ExecutionTimer.time(ExecutionTimer.scala:81)
at is.hail.expr.ir.lowering.LoweringPass.$anonfun$apply$1(LoweringPass.scala:16)
at is.hail.utils.ExecutionTimer.time(ExecutionTimer.scala:81)
at is.hail.expr.ir.lowering.LoweringPass.apply(LoweringPass.scala:14)
at is.hail.expr.ir.lowering.LoweringPass.apply$(LoweringPass.scala:13)
at is.hail.expr.ir.lowering.LowerOrInterpretNonCompilablePass$.apply(LoweringPass.scala:64)
at is.hail.expr.ir.lowering.LoweringPipeline.$anonfun$apply$1(LoweringPipeline.scala:15)
at is.hail.expr.ir.lowering.LoweringPipeline.$anonfun$apply$1$adapted(LoweringPipeline.scala:13)
at scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:36)
at scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:38)
at is.hail.expr.ir.lowering.LoweringPipeline.apply(LoweringPipeline.scala:13)
at is.hail.expr.ir.CompileAndEvaluate$._apply(CompileAndEvaluate.scala:47)
at is.hail.backend.spark.SparkBackend._execute(SparkBackend.scala:381)
at is.hail.backend.spark.SparkBackend.$anonfun$executeEncode$2(SparkBackend.scala:417)
at is.hail.backend.ExecuteContext$.$anonfun$scoped$3(ExecuteContext.scala:47)
at is.hail.utils.package$.using(package.scala:638)
at is.hail.backend.ExecuteContext$.$anonfun$scoped$2(ExecuteContext.scala:47)
at is.hail.utils.package$.using(package.scala:638)
at is.hail.annotations.RegionPool$.scoped(RegionPool.scala:17)
at is.hail.backend.ExecuteContext$.scoped(ExecuteContext.scala:46)
at is.hail.backend.spark.SparkBackend.withExecuteContext(SparkBackend.scala:275)
at is.hail.backend.spark.SparkBackend.$anonfun$executeEncode$1(SparkBackend.scala:414)
at is.hail.utils.ExecutionTimer$.time(ExecutionTimer.scala:52)
at is.hail.backend.spark.SparkBackend.executeEncode(SparkBackend.scala:413)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)
at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)
at py4j.Gateway.invoke(Gateway.java:282)
at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
at py4j.commands.CallCommand.execute(CallCommand.java:79)
at py4j.GatewayConnection.run(GatewayConnection.java:238)
at java.lang.Thread.run(Thread.java:748)

Hail version: 0.2.82-290eaf334217
Error summary: IllegalArgumentException: requirement failed

I would like to appreciate for any helps and suggestions. Thanks!

Hi @yluo411, sorry that you are running into issues with Hail. This problem is caused by a known issue (#11335) which we don’t have a fix for yet, but the team is working on it.

Thank you so much for your reply. May I kindly double check whether the issue has been resolved. And what should I do regarding this issue. I just rerun it and looks like my code has the same error. Do I need to reinstall and install anything? Thanks

The main hail branch on github has been updated, but we haven’t released a new version with the fix yet. You can either build hail from source or wait a day or two for hail 0.2.85 to be released.

I see. Thank you so much for your quick reply.

The PR that will cause a new version to be released is here: Release 0.2.85 by johnc1231 · Pull Request #11363 · hail-is/hail · GitHub

Should go in tomorrow.

We released hail 0.2.85. Update to latest and this error should be resolved.

Thank you so much. The code can run now.