Skip to content

Commit

Permalink
test: doctest function calls fixed in studyindex
Browse files Browse the repository at this point in the history
  • Loading branch information
d0choa committed Dec 12, 2023
1 parent 252399f commit 36fb79b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/otg/datasource/gwas_catalog/study_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def _parse_discovery_samples(discovery_samples: Column) -> Column:
... ).alias('discoverySampleSize')
... )
... .orderBy('studyId')
... .withColumn('discoverySampleSize', GWASCatalogStudyIndex._parse_discovery_samples(f.col('discoverySampleSize')))
... .withColumn('discoverySampleSize', StudyIndexGWASCatalogParser._parse_discovery_samples(f.col('discoverySampleSize')))
... .select('discoverySampleSize')
... .show(truncate=False)
... )
Expand Down Expand Up @@ -178,7 +178,7 @@ def _merge_ancestries_and_counts(ancestry_group: Column) -> Column:
>>> data = [(12, ['African', 'European']),(12, ['African'])]
>>> (
... spark.createDataFrame(data, ['sample_count', 'ancestries'])
... .select(GWASCatalogStudyIndex._merge_ancestries_and_counts(f.struct('sample_count', 'ancestries')).alias('test'))
... .select(StudyIndexGWASCatalogParser._merge_ancestries_and_counts(f.struct('sample_count', 'ancestries')).alias('test'))
... .show(truncate=False)
... )
+-------------------------------+
Expand Down Expand Up @@ -213,7 +213,7 @@ def parse_cohorts(raw_cohort: Column) -> Column:
Examples:
>>> data = [('BioME|CaPS|Estonia|FHS|UKB|GERA|GERA|GERA',),(None,),]
>>> spark.createDataFrame(data, ['cohorts']).select(GWASCatalogStudyIndex.parse_cohorts(f.col('cohorts')).alias('parsedCohorts')).show(truncate=False)
>>> spark.createDataFrame(data, ['cohorts']).select(StudyIndexGWASCatalogParser.parse_cohorts(f.col('cohorts')).alias('parsedCohorts')).show(truncate=False)
+--------------------------------------+
|parsedCohorts |
+--------------------------------------+
Expand Down

0 comments on commit 36fb79b

Please sign in to comment.