From 6b4cdf92b82fa143e4217a2e5da46d04f2585de8 Mon Sep 17 00:00:00 2001 From: Marco Perini Date: Wed, 12 Jun 2024 03:06:21 +0200 Subject: [PATCH] fix: common params --- scrapegraphai/nodes/base_node.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scrapegraphai/nodes/base_node.py b/scrapegraphai/nodes/base_node.py index 60f4c946..bd95cd28 100644 --- a/scrapegraphai/nodes/base_node.py +++ b/scrapegraphai/nodes/base_node.py @@ -88,12 +88,11 @@ class BaseNode(ABC): param (dict): The dictionary to update node_config with. overwrite (bool): Flag indicating if the values of node_config should be overwritten if their value is not None. """ - if self.node_config is None: - self.node_config = {} + for key, val in params.items(): - if hasattr(self, key) and (key not in self.node_config or overwrite): - self.node_config[key] = val - setattr(self, key, val) + if hasattr(self, key) and not overwrite: + continue + setattr(self, key, val) def get_input_keys(self, state: dict) -> List[str]: """