Skip to content

Commit

Permalink
Blacken code
Browse files Browse the repository at this point in the history
  • Loading branch information
jlubken committed Aug 19, 2021
1 parent 28a1454 commit 4e820ee
Show file tree
Hide file tree
Showing 8 changed files with 253 additions and 185 deletions.
31 changes: 31 additions & 0 deletions assets/postgres/epic/notifications/recent.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
with args as (
select
cast(%(notification_id)s as int) as notification_id
)
select
n.id
p.id as prediction_id,
p.run_id,
p.csn,
p.empi,
p.score,
r.as_of
from
args
join runs as r
upper(r.interval) != 'infinity'
join predictions as p on
p.run_id = r.id
join epic_notifications as n on
n.prediction_id = p.id
and n.id <= args.notification_id
left join epic_verifcations as v on
v.notification_id = n.id
left join epic_verification_errors as e on
e.notification_id = n.id
and e.acknowledged_on is null
where
v.id is null
and e.id is null
order by
r.id, p.id
1 change: 1 addition & 0 deletions assets/postgres/epic/notifications/recover.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ from
v.notification_id = n.id
left join epic_verification_errors as e on
e.notification_id = n.id
and e.acknowledged_on is null
where
v.id is null
and e.id is null
Expand Down
28 changes: 28 additions & 0 deletions assets/postgres/predictions/recent.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
with args as (
select
cast(%(prediction_id)s as int) as prediction_id
)
select
p.id,
p.run_id,
p.csn,
p.empi,
p.score,
r.as_of
from
args
join runs as r
upper(r.interval) != 'infinity'
join predictions as p on
p.id <= args.prediction_id
and p.run_id = r.id
left join epic_notifications as n on
n.prediction_id = p.id
left join epic_notification_errors as e on
e.prediction_id = p.id
and e.acknowledged_on is null
where
n.id is null
and e.id is null
order by
r.id, p.id
2 changes: 1 addition & 1 deletion assets/postgres/predictions/recover.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ where
n.id is null
and e.id is null
order by
p.id
r.id, p.id
2 changes: 1 addition & 1 deletion postgres/sql/patchdb.d/007.epic.sql
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ begin
on delete cascade
on update cascade
);
create trigger epci_verifications_inserted after insert on epic_verifications
create trigger epic_verifications_inserted after insert on epic_verifications
referencing new table as inserted
for each statement
execute procedure call_notify();
Expand Down
16 changes: 6 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
"numpy>=1.15.4",
"pandas>=0.23.4",
"pip>=21.2.2",
"requests>=2.26.0",
"setuptools>=57.4.0",
"wheel>=0.35.1",
)

EPIC_REQUIRES = ("requests",)

PYMSSQL_REQUIRES = ("cython>=0.29.21", "pymssql>=2.1.4")

PSYCOPG2_REQUIRES = ("psycopg2-binary>=2.8.6",)
Expand Down Expand Up @@ -56,17 +55,14 @@
setup(
entry_points={
"console_scripts": [
"epic-notify = dsdk.epic:Notify.main",
"epic-validate = dsdk.epic:Validate.main",
"epic-notify = dsdk.epic:Notifier.main",
"epic-validate = dsdk.epic:Validator.main",
"epic-notify-test = dsdk.epic:Notifier.test",
"epic-validate-test = dsdk.epic:Notifier.test",
]
},
extras_require={
"all": (
EPIC_REQUIRES
+ PSYCOPG2_REQUIRES
+ PYMSSQL_REQUIRES
+ TEST_REQUIRES
),
"all": (PSYCOPG2_REQUIRES + PYMSSQL_REQUIRES + TEST_REQUIRES),
"psycopg2": PSYCOPG2_REQUIRES,
"pymssql": PYMSSQL_REQUIRES,
"test": TEST_REQUIRES,
Expand Down
Loading

0 comments on commit 4e820ee

Please sign in to comment.