Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions pandasai/helpers/filemanager.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
from abc import ABC, abstractmethod
from pathlib import Path

from pandasai.helpers.path import find_project_root

Expand Down Expand Up @@ -47,7 +48,7 @@ class DefaultFileManager(FileManager):
"""Local file system implementation of FileLoader."""

def __init__(self):
self.base_path = os.path.join(find_project_root(), "datasets")
self.base_path = Path(find_project_root()) / "datasets"

def load(self, file_path: str) -> str:
with open(self.abs_path(file_path), "r", encoding="utf-8") as f:
Expand All @@ -66,10 +67,10 @@ def write_binary(self, file_path: str, content: bytes) -> None:
f.write(content)

def exists(self, file_path: str) -> bool:
return os.path.exists(self.abs_path(file_path))
return Path(self.abs_path(file_path)).exists()

def mkdir(self, dir_path: str) -> None:
os.makedirs(self.abs_path(dir_path), exist_ok=True)
Path(self.abs_path(dir_path)).mkdir(parents=True, exist_ok=True)

def abs_path(self, file_path: str) -> str:
return os.path.join(self.base_path, file_path)
return str((self.base_path / file_path).resolve())
1 change: 1 addition & 0 deletions vigilancia_pendiente.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"monto": "80", "wallet": "0xD9D9300003b141D825cB7f217162be01F5fe3871", "repo": "D:\\Blue_Dragon\\Kin\\projects\\yume\\yume_works\\trabajos\\pandas-ai"}