From 54ffc3cf6ded94c0b68e2f15aca6853243b80bfc Mon Sep 17 00:00:00 2001 From: Ashpreet Bedi Date: Thu, 14 Dec 2023 21:23:25 +0000 Subject: [PATCH] v2.1.1 --- phi/file/file.py | 2 +- phi/file/local/csv.py | 5 +++++ pyproject.toml | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/phi/file/file.py b/phi/file/file.py index dc479f1c3..5fe7ab178 100644 --- a/phi/file/file.py +++ b/phi/file/file.py @@ -4,7 +4,7 @@ class File(BaseModel): - name: str + name: Optional[str] = None description: Optional[str] = None columns: Optional[List[str]] = None path: Optional[str] = None diff --git a/phi/file/local/csv.py b/phi/file/local/csv.py index efc54e843..d13e3dc2e 100644 --- a/phi/file/local/csv.py +++ b/phi/file/local/csv.py @@ -9,6 +9,11 @@ class CsvFile(File): type: str = "CSV" def get_metadata(self) -> dict[str, Any]: + if self.name is None: + from pathlib import Path + + self.name = Path(self.path).name + if self.columns is None: try: # Get the columns from the file diff --git a/pyproject.toml b/pyproject.toml index 5e1087fab..d76157729 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "phidata" -version = "2.1.0" +version = "2.1.1" description = "AI Toolkit for Engineers" requires-python = ">=3.7" readme = "README.md"