misc: display last update time in a human format (#42447)
This commit is contained in:
parent
c7ebf40039
commit
a0cf6fb047
|
@ -16,6 +16,7 @@
|
|||
|
||||
import collections
|
||||
import contextlib
|
||||
import datetime
|
||||
import logging
|
||||
import itertools
|
||||
import hashlib
|
||||
|
@ -526,6 +527,9 @@ class Engine(object):
|
|||
def __getattr__(self, name):
|
||||
return getattr(self.warehouse, name)
|
||||
|
||||
def timestamp(self):
|
||||
return datetime.datetime.fromtimestamp(self.warehouse.timestamp) if self.warehouse.timestamp else None
|
||||
|
||||
@contextlib.contextmanager
|
||||
def get_cursor(self):
|
||||
with contextlib.closing(psycopg2.connect(self.warehouse.pg_dsn)) as connection:
|
||||
|
|
Loading…
Reference in New Issue