Skip to content

Commit

Permalink
fix: prevent multiple filters to override spark plan
Browse files Browse the repository at this point in the history
  • Loading branch information
d0choa committed Sep 17, 2024
1 parent 34aaaf5 commit a358781
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/gentropy/dataset/study_locus.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,14 +534,16 @@ def filter_credible_set(
Returns:
StudyLocus: Filtered study-locus dataset.
"""
self.df = self._df.withColumn(
"locus",
f.filter(
f.col("locus"),
lambda tag: (tag[credible_interval.value]),
return StudyLocus(
_df=self._df.withColumn(
"locus",
f.filter(
f.col("locus"),
lambda tag: (tag[credible_interval.value]),
),
),
_schema=self._schema,
)
return self

@staticmethod
def filter_ld_set(ld_set: Column, r2_threshold: float) -> Column:
Expand Down

0 comments on commit a358781

Please sign in to comment.