From f45d3ce837e68623c936e27e38d5438b2eb362aa Mon Sep 17 00:00:00 2001 From: Zach Barnett Date: Wed, 30 Oct 2024 09:06:33 -0500 Subject: [PATCH] add more debugging --- .../cassandra_online_store.py | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/sdk/python/feast/infra/online_stores/contrib/cassandra_online_store/cassandra_online_store.py b/sdk/python/feast/infra/online_stores/contrib/cassandra_online_store/cassandra_online_store.py index d0768abac3..628d9d262f 100644 --- a/sdk/python/feast/infra/online_stores/contrib/cassandra_online_store/cassandra_online_store.py +++ b/sdk/python/feast/infra/online_stores/contrib/cassandra_online_store/cassandra_online_store.py @@ -215,6 +215,20 @@ class CassandraOnlineStore(OnlineStore): _keyspace: str = "feast_keyspace" _prepared_statements: Dict[str, PreparedStatement] = {} + def _log_all_tables(self, config: RepoConfig): + session = self._get_session(config) + keyspace = self._keyspace + + logger.debug(f"Listing all tables in keyspace '{keyspace}'") + + query = f"SELECT table_name FROM system_schema.tables WHERE keyspace_name = '{keyspace}';" + result = session.execute(query) + + logger.debug(f"Rows in keyspace '{keyspace}': {result}") + + tables = [row.table_name for row in result] + logger.debug(f"Tables in keyspace '{keyspace}': {tables}") + def _get_session(self, config: RepoConfig): """ Establish the database connection, if not yet created, @@ -294,10 +308,10 @@ def _get_session(self, config: RepoConfig): # creation of Cluster (Cassandra vs. Astra) if hosts: - logger.info(f"Connecting to Cassandra cluster at {hosts}.") - logger.info(f"Username: {username}.") - logger.info(f"Keyspace: {keyspace}.") - logger.info(f"Port: {port}.") + logger.debug(f"Connecting to Cassandra cluster at {hosts}.") + logger.debug(f"Username: {username}.") + logger.debug(f"Keyspace: {keyspace}.") + logger.debug(f"Port: {port}.") self._cluster = Cluster( hosts, port=port, auth_provider=auth_provider, **cluster_kwargs ) @@ -460,6 +474,8 @@ def update( """ project = config.project + self._log_all_tables(config) + for table in tables_to_keep: self._create_table(config, project, table) for table in tables_to_delete: