Skip to content

Commit

Permalink
Merge pull request #40 from PGScatalog/bugfix_schema
Browse files Browse the repository at this point in the history
Fix assertion errors
  • Loading branch information
nebfield authored Jan 27, 2023
2 parents e220f14 + 4166333 commit 6735566
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pgscatalog_utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.3.0'
__version__ = '0.3.1'
1 change: 1 addition & 0 deletions pgscatalog_utils/match/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def read_scorefile(path: str, chrom: typing.Union[str, None]) -> pl.LazyFrame:
'chr_position': pl.UInt64,
'effect_allele': pl.Utf8, # str functions required to complement
'other_allele': pl.Utf8,
'effect_weight': pl.Float64,
'effect_type': pl.Categorical,
'accession': pl.Categorical}

Expand Down
2 changes: 1 addition & 1 deletion pgscatalog_utils/match/write.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def _check_column_types(matches: pl.LazyFrame):
'matched_effect_allele': pl.Categorical, 'effect_weight': pl.Float64,
'effect_type': pl.Categorical, 'accession': pl.Categorical}
col_types = {x: matches.schema.get(x) for x in list((matches.schema.keys() & correct_schema.keys()))}
assert col_types == correct_schema
assert col_types == correct_schema, "MISMATCHED SCHEMA\nCurrent columns: {}\nCorrect schema:{}".format(col_types, correct_schema)


def _write_split(deduplicated: dict[str: tuple[int, pl.LazyFrame]], chrom: str, dataset: str):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pgscatalog_utils"
version = "0.3.0"
version = "0.3.1"
description = "Utilities for working with PGS Catalog API and scoring files"
homepage = "https://github.com/PGScatalog/pgscatalog_utils"
authors = ["Benjamin Wingfield <[email protected]>", "Samuel Lambert <[email protected]>", "Laurent Gil <[email protected]>"]
Expand Down

0 comments on commit 6735566

Please sign in to comment.