From 294d8168c667cae671a8fe23cd8495374cc3249d Mon Sep 17 00:00:00 2001 From: Glauber Costa Vila Verde Date: Wed, 16 Oct 2024 10:40:04 -0700 Subject: [PATCH] Added more logs and test access to consdb tables --- python/lsst/consdb/efd_transform/dao/base.py | 4 ++-- python/lsst/consdb/efd_transform/transform_efd.py | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/python/lsst/consdb/efd_transform/dao/base.py b/python/lsst/consdb/efd_transform/dao/base.py index 92675267..39a276a2 100644 --- a/python/lsst/consdb/efd_transform/dao/base.py +++ b/python/lsst/consdb/efd_transform/dao/base.py @@ -102,9 +102,9 @@ def get_table(self, tablename, schema=None) -> Table: metadata.reflect(bind=engine) if schema: - tbl = Table(tablename, metadata, autoload_with=True, schema=schema) + tbl = Table(tablename, metadata, autoload=True, autoload_with=self.get_con(), schema=schema) else: - tbl = Table(tablename, metadata, autoload_with=True) + tbl = Table(tablename, metadata, autoload=True, autoload_with=self.get_con()) return tbl def execute(self, stm): diff --git a/python/lsst/consdb/efd_transform/transform_efd.py b/python/lsst/consdb/efd_transform/transform_efd.py index 31e5004a..28b1b776 100644 --- a/python/lsst/consdb/efd_transform/transform_efd.py +++ b/python/lsst/consdb/efd_transform/transform_efd.py @@ -172,12 +172,22 @@ async def main() -> None: consdb_url = args.db_conn_str log.debug(f"ConsDB URL: {consdb_url}") - from dao.base import DBBase try: + from dao.base import DBBase + from dao.exposure_efd import ExposureEfdDao + from dao.visit_efd import VisitEfdDao consdb = DBBase(consdb_url) log.debug(f"ConsDB engine: {consdb.get_db_engine()}") log.debug(f"ConsDB connection: {consdb.get_con()}") log.debug("Postgres connection successful") + + log.debug("Testing table ExposureEFD") + expdao = ExposureEfdDao(consdb_url) + log.debug(f"ExposureEFD table: {expdao.tbl}") + + log.debug("Testing table VisitEFD") + visdao = VisitEfdDao(consdb_url) + log.debug(f"VisitEFD table: {visdao.tbl}") except Exception as e: log.error(f"Postgres connection failed: {e}") sys.exit(1)