Lazy import of sqlalchemy
This commit is contained in:
parent
3d52b1b2c7
commit
b54e31f4fd
1 changed files with 2 additions and 1 deletions
|
@ -1,15 +1,16 @@
|
|||
import sqlalchemy as db
|
||||
import numpy as np
|
||||
from collections import OrderedDict
|
||||
import os.path
|
||||
|
||||
def init_db():
|
||||
import sqlalchemy as db
|
||||
_verbose = False #True
|
||||
engine = db.create_engine('postgresql://hpc@hawk-monitor4:5432/coe_mon', echo=_verbose)
|
||||
conn = engine.connect()
|
||||
return conn
|
||||
|
||||
def init_query(jobid, interval):
|
||||
import sqlalchemy as db
|
||||
query_string = """with job as (
|
||||
select job_id, starttime, endtime, nodes from jobs where job_id='{jobid}.hawk-pbs5'
|
||||
),
|
||||
|
|
Loading…
Reference in a new issue