def wrap_input(interval): if interval is None: raise TypeError("'filter_intervals' does not allow missing values in 'intervals'.") elif needs_wrapper: return Interval(Struct(**{k_name: interval.start}), Struct(**{k_name: interval.end}), interval.includes_start, interval.includes_end) else: return interval
def _convert_to_py(self, annotation): if annotation is not None: d = dict() for i, (f, t) in enumerate(self.items()): d[f] = t._convert_to_py(annotation.get(i)) return Struct(**d) else: return None
def _convert_to_py(self, annotation): if annotation is not None: d = dict() for i, f in enumerate(self.fields): d[f.name] = f.typ._convert_to_py(annotation.get(i)) return Struct(**d) else: return None
def _convert_from_json(self, x): from hail.utils import Struct return Struct(**{f: t._convert_from_json_na(x.get(f)) for f, t in self.items()})
def _convert_from_json(self, x): return Struct( **{f: t._convert_from_json_na(x.get(f)) for f, t in self.items()})