Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[project]
name = "dwclib"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
Expand All @@ -14,10 +17,10 @@ repository = "https://github.com/larib-data/dwclib"
[tool.poetry.dependencies]
python = ">=3.8,<4"
numpy = "^1"
pandas = ">=1.4,<3"
pandas = ">=2.2.0"
dask = ">=2023"
SQLAlchemy = "~1.4"
platformdirs = "^3.0.0"
SQLAlchemy = ">=2.0.25"
platformdirs = ">=4.2.0"

[tool.poetry.dev-dependencies]
flake8 = "^4.0.1"
Expand Down
4 changes: 2 additions & 2 deletions src/dwclib/alerts/alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ def run_alerts_query(


def build_alerts_query(engine, dtbegin, dtend, patientids):
dbmeta = MetaData(bind=engine)
at = Table('Alert_', dbmeta, schema='_Export', autoload=True, autoload_with=engine)
dbmeta = MetaData()
at = Table('Alert_', dbmeta, schema='_Export', autoload_with=engine)

aq = select(
at.c.AlertId,
Expand Down
6 changes: 3 additions & 3 deletions src/dwclib/common/numerics.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ def run_numerics_query(


def build_numerics_query(engine, dtbegin, dtend, patientids, labels, sublabels):
dbmeta = MetaData(bind=engine)
dbmeta = MetaData()
nnt = Table(
'Numeric_', dbmeta, schema='_Export', autoload=True, autoload_with=engine
'Numeric_', dbmeta, schema='_Export', autoload_with=engine
)
nvt = Table(
'NumericValue_', dbmeta, schema='_Export', autoload=True, autoload_with=engine
'NumericValue_', dbmeta, schema='_Export', autoload_with=engine
)

nn = select(nnt.c.TimeStamp, nnt.c.Id, nnt.c.Label, nnt.c.SubLabel)
Expand Down
6 changes: 3 additions & 3 deletions src/dwclib/common/waves.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ def run_waves_query(uri, dtbegin, dtend, patientid, labels):


def build_waves_query(engine, dtbegin, dtend, patientid, labels):
dbmeta = MetaData(bind=engine)
wwt = Table('Wave_', dbmeta, schema='_Export', autoload=True, autoload_with=engine)
dbmeta = MetaData()
wwt = Table('Wave_', dbmeta, schema='_Export', autoload_with=engine)
wst = Table(
'WaveSample_', dbmeta, schema='_Export', autoload=True, autoload_with=engine
'WaveSample_', dbmeta, schema='_Export', autoload_with=engine
)

ww = select(
Expand Down
6 changes: 3 additions & 3 deletions src/dwclib/enumerations/enumerations.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ def run_enumerations_query(


def build_enumerations_query(engine, dtbegin, dtend, patientids, labels):
dbmeta = MetaData(bind=engine)
eet = Table('Enumeration_', dbmeta, schema='_Export', autoload=True, autoload_with=engine)
evt = Table('EnumerationValue_', dbmeta, schema='_Export', autoload=True, autoload_with=engine)
dbmeta = MetaData()
eet = Table('Enumeration_', dbmeta, schema='_Export', autoload_with=engine)
evt = Table('EnumerationValue_', dbmeta, schema='_Export', autoload_with=engine)

ee = select(eet.c.TimeStamp, eet.c.Id, eet.c.Label)
ee = ee.with_hint(eet, 'WITH (NOLOCK)')
Expand Down
4 changes: 2 additions & 2 deletions src/dwclib/patients/patients.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def build_query(
numericsublabels,
):
pgdb = create_engine(uri)
pgmeta = MetaData(bind=pgdb)
pgmeta = MetaData()

t_patients = Table('patients', pgmeta, autoload_with=pgdb)
p = t_patients.c
Expand All @@ -136,7 +136,7 @@ def build_query(
t_patients = select(fields).cte() # Replace Patients table with CTE
p = t_patients.c

q = select([t_patients, pl.numericlabels, pl.numericsublabels, pl.wavelabels])
q = select(t_patients, pl.numericlabels, pl.numericsublabels, pl.wavelabels)
q = q.select_from(t_patients.join(t_patientlabels, pl.patientid == p.patientid, isouter=True))
if patientid:
q = q.where(p.patientid == patientid)
Expand Down