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 4de6c049bf..ffdc90feae 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 @@ -213,10 +213,12 @@ def shutdown(self): """ Shutdown the Cassandra cluster and session. """ - if not self._session.is_shutdown: - self._session.shutdown() - if not self._cluster.is_shutdown: - self._cluster.shutdown() + if self._session: + if not self._session.is_shutdown: + self._session.shutdown() + if self._cluster: + if not self._cluster.is_shutdown: + self._cluster.shutdown() def _get_cluster(self, config: RepoConfig): """