From 1c805dcf6f73a7114761fbf6680ce7442f8d4b92 Mon Sep 17 00:00:00 2001 From: Badr Date: Sun, 29 Oct 2023 16:33:49 -0400 Subject: [PATCH] Update naive_bayes.py --- verticapy/machine_learning/vertica/naive_bayes.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/verticapy/machine_learning/vertica/naive_bayes.py b/verticapy/machine_learning/vertica/naive_bayes.py index 9d40f2e54..cc25829b6 100755 --- a/verticapy/machine_learning/vertica/naive_bayes.py +++ b/verticapy/machine_learning/vertica/naive_bayes.py @@ -21,6 +21,7 @@ from verticapy._utils._sql._collect import save_verticapy_logs from verticapy._utils._sql._format import quote_ident from verticapy._utils._sql._vertica_version import check_minimum_version +from verticapy.errors import MissingRelation from verticapy.core.vdataframe.base import vDataFrame @@ -593,7 +594,10 @@ def _get_nb_attributes(self) -> list[dict]: Returns a list of dictionary for each of the NB variables. It is used to translate NB to Python. """ - vdf = vDataFrame(self.input_relation) + try: + vdf = vDataFrame(self.input_relation) + except MissingRelation: + return [] var_info = {} gaussian_incr, bernoulli_incr, multinomial_incr = 0, 0, 0 for idx, elem in enumerate(self.X):