Skip to content

Commit 9e3171b

Browse files
committed
feat: add copy for smart_scraper_multi_concat
1 parent 2ae26e9 commit 9e3171b

File tree

5 files changed

+4
-35
lines changed

5 files changed

+4
-35
lines changed

scrapegraphai/graphs/csv_scraper_multi_graph.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@ def _create_graph(self) -> BaseGraph:
6161
BaseGraph: A graph instance representing the web scraping and searching workflow.
6262
"""
6363

64-
# smart_scraper_instance = CSVScraperGraph(
65-
# prompt="",
66-
# source="",
67-
# config=self.copy_config,
68-
# )
69-
7064
graph_iterator_node = GraphIteratorNode(
7165
input="user_prompt & jsons",
7266
output=["results"],

scrapegraphai/graphs/json_scraper_multi_graph.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,6 @@ def _create_graph(self) -> BaseGraph:
6161
BaseGraph: A graph instance representing the web scraping and searching workflow.
6262
"""
6363

64-
# smart_scraper_instance = JSONScraperGraph(
65-
# prompt="",
66-
# source="",
67-
# config=self.copy_config,
68-
# schema=self.copy_schema
69-
# )
70-
7164
graph_iterator_node = GraphIteratorNode(
7265
input="user_prompt & jsons",
7366
output=["results"],

scrapegraphai/graphs/markdown_scraper_multi_graph.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,7 @@ def _create_graph(self) -> BaseGraph:
5555
Returns:
5656
BaseGraph: A graph instance representing the web scraping and searching workflow.
5757
"""
58-
# smart_scraper_instance = MDScraperGraph(
59-
# prompt="",
60-
# source="",
61-
# config=self.copy_config,
62-
# schema=self.copy_schema
63-
# )
6458

65-
# Define the graph nodes
6659
graph_iterator_node = GraphIteratorNode(
6760
input="user_prompt & jsons",
6861
output=["results"],

scrapegraphai/graphs/pdf_scraper_multi_graph.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,6 @@ def _create_graph(self) -> BaseGraph:
5959
BaseGraph: A graph instance representing the web scraping and searching workflow.
6060
"""
6161

62-
# pdf_scraper_instance = PDFScraperGraph(
63-
# prompt="",
64-
# source="",
65-
# config=self.copy_config,
66-
# schema=self.copy_schema
67-
# )
68-
6962
graph_iterator_node = GraphIteratorNode(
7063
input="user_prompt & pdfs",
7164
output=["results"],

scrapegraphai/graphs/smart_scraper_multi_concat_graph.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22
SmartScraperMultiGraph Module
33
"""
44

5-
from copy import copy, deepcopy
5+
from copy import deepcopy
66
from typing import List, Optional
77
from pydantic import BaseModel
8-
98
from .base_graph import BaseGraph
109
from .abstract_graph import AbstractGraph
1110
from .smart_scraper_graph import SmartScraperGraph
12-
1311
from ..nodes import (
1412
GraphIteratorNode,
1513
ConcatAnswersNode
1614
)
15+
from ..utils.copy import safe_deepcopy
1716

1817

1918
class SmartScraperMultiConcatGraph(AbstractGraph):
@@ -46,11 +45,8 @@ class SmartScraperMultiConcatGraph(AbstractGraph):
4645

4746
def __init__(self, prompt: str, source: List[str],
4847
config: dict, schema: Optional[BaseModel] = None):
49-
50-
if all(isinstance(value, str) for value in config.values()):
51-
self.copy_config = copy(config)
52-
else:
53-
self.copy_config = deepcopy(config)
48+
49+
self.copy_config = safe_deepcopy(config)
5450

5551
self.copy_schema = deepcopy(schema)
5652

0 commit comments

Comments
 (0)