From 938b9030e3e78078e587c0261cde01600a146495 Mon Sep 17 00:00:00 2001 From: James Crabtree Date: Tue, 24 Oct 2023 20:21:09 -0500 Subject: [PATCH] master resolve bug causing pod logs to not be printed Signed-off-by: James Crabtree --- .../contrib/bytewax/bytewax_materialization_engine.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sdk/python/feast/infra/materialization/contrib/bytewax/bytewax_materialization_engine.py b/sdk/python/feast/infra/materialization/contrib/bytewax/bytewax_materialization_engine.py index 5f85a1f001..1c9dc6a6be 100644 --- a/sdk/python/feast/infra/materialization/contrib/bytewax/bytewax_materialization_engine.py +++ b/sdk/python/feast/infra/materialization/contrib/bytewax/bytewax_materialization_engine.py @@ -248,9 +248,6 @@ def _await_path_materialization( f"(of {total_pods}) complete with status {job.status()}" ) except BaseException as e: - if self.batch_engine_config.print_pod_logs_on_failure: - self._print_pod_logs(job.job_id(), feature_view, batch_start) - logger.info(f"Deleting job {job.job_id()}") try: self.batch_v1.delete_namespaced_job(job.job_id(), self.namespace) @@ -268,6 +265,12 @@ def _await_path_materialization( f"Could not delete configmap due to API Error: {ae.body}" ) + if ( + job.status() == MaterializationJobStatus.ERROR + and self.batch_engine_config.print_pod_logs_on_failure + ): + self._print_pod_logs(job.job_id(), feature_view, batch_start) + return job def _print_pod_logs(self, job_id, feature_view, offset=0):