Skip to content

Python scraper based on AI

refactoring for pylint

VinciGit00db6d988b2d90
diff --git a/scrapegraphai/models/gemini.py b/scrapegraphai/models/gemini.py
index 95ee2d57..d22b58ad 100644
--- a/scrapegraphai/models/gemini.py
+++ b/scrapegraphai/models/gemini.py
@@ -1,3 +1,6 @@
+"""
+Module for configuration of Gemini
+"""
from langchain_google_genai import ChatGoogleGenerativeAI
diff --git a/scrapegraphai/nodes/base_node.py b/scrapegraphai/nodes/base_node.py
index e9766588..d3042b8e 100644
--- a/scrapegraphai/nodes/base_node.py
+++ b/scrapegraphai/nodes/base_node.py
@@ -40,7 +40,8 @@ class BaseNode(ABC):
raised to indicate the incorrect usage.
"""
- def __init__(self, node_name: str, node_type: str, input: str, output: List[str], min_input_len: int = 1, model_config: Optional[dict] = None):
+ def __init__(self, node_name: str, node_type: str, input: str, output: List[str],
+ min_input_len: int = 1, model_config: Optional[dict] = None):
"""
Initialize the node with a unique identifier and a specified node type.
@@ -73,7 +74,10 @@ class BaseNode(ABC):
pass
def get_input_keys(self, state: dict) -> List[str]:
- # Use the _parse_input_keys method to identify which state keys are needed based on the input attribute
+ """
+ Use the _parse_input_keys method to identify which state keys are needed
+ based on the input attribute
+ """
try:
input_keys = self._parse_input_keys(state, self.input)
self._validate_input_keys(input_keys)
@@ -85,7 +89,8 @@ class BaseNode(ABC):
def _validate_input_keys(self, input_keys):
if len(input_keys) < self.min_input_len:
raise ValueError(
- f"{self.node_name} requires at least {self.min_input_len} input keys, got {len(input_keys)}.")
+ f"""{self.node_name} requires at least {self.min_input_len} input keys,
+ got {len(input_keys)}.""")
def _parse_input_keys(self, state: dict, expression: str) -> List[str]:
"""