diff --git a/sdk/python/feast/infra/offline_stores/contrib/spark_offline_store/time_dependent_spark_source.py b/sdk/python/feast/infra/offline_stores/contrib/spark_offline_store/time_dependent_spark_source.py index 8af17e4545..c587c33570 100644 --- a/sdk/python/feast/infra/offline_stores/contrib/spark_offline_store/time_dependent_spark_source.py +++ b/sdk/python/feast/infra/offline_stores/contrib/spark_offline_store/time_dependent_spark_source.py @@ -157,11 +157,11 @@ def get_table_query_string(self, **kwargs) -> str: raise AssertionError("Could not find an active spark session.") try: df = spark_session.read.format(self.file_format).load(*paths) - except Exception: - logger.exception( - "Spark read of file source failed.\n" + traceback.format_exc() - ) - tmp_table_name = get_temp_entity_table_name() - df.createOrReplaceTempView(tmp_table_name) - - return f"`{tmp_table_name}`" + tmp_table_name = get_temp_entity_table_name() + df.createOrReplaceTempView(tmp_table_name) + + return f"`{tmp_table_name}`" + except Exception as e: + msg = "Spark read of file source failed.\n" + traceback.format_exc() + logger.exception(msg) + raise Exception(msg) from e