Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug: log info #150

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -294,6 +308,10 @@ def _get_session(self, config: RepoConfig):

# creation of Cluster (Cassandra vs. Astra)
if hosts:
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
)
Expand Down Expand Up @@ -456,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:
Expand Down
Loading