Skip to content

Commit 74d7ef6

Browse files
committed
refactor of conbert to json function
1 parent ec3fef9 commit 74d7ef6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scrapegraphai/utils/convert_to_json.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def convert_to_json(data: dict, filename: str, position: str = None):
2222
PermissionError: If the program does not have permission to write to the directory.
2323
"""
2424
if ".json" in filename:
25-
raise ValueError("The filename should not contain '.json'")
25+
filename = filename.replace(".json", "") # Remove .csv extension
2626

2727
# Get the directory of the caller script
2828
if position is None:

0 commit comments

Comments
 (0)