From eb309feccb2179896335ded54baa3c33efc86665 Mon Sep 17 00:00:00 2001 From: sss04 Date: Mon, 12 Aug 2024 13:32:28 -0500 Subject: [PATCH] fix: tiny bug fix to avoid KeyError (#2264) --- core/src/main/python/synapse/ml/core/logging/SynapseMLLogger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/python/synapse/ml/core/logging/SynapseMLLogger.py b/core/src/main/python/synapse/ml/core/logging/SynapseMLLogger.py index 38b244b3e4..37fed9e9da 100644 --- a/core/src/main/python/synapse/ml/core/logging/SynapseMLLogger.py +++ b/core/src/main/python/synapse/ml/core/logging/SynapseMLLogger.py @@ -293,7 +293,7 @@ def log_fit(): @classmethod def get_column_number(cls, args, kwargs): - if kwargs and kwargs["df"] and isinstance(kwargs["df"], DataFrame): + if kwargs and kwargs.get("df") and isinstance(kwargs["df"], DataFrame): return len(kwargs["df"].columns) elif args and len(args) > 0 and isinstance(args[0], DataFrame): return len(args[0].columns)