Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: type hint for property last_prompt_id #750

Merged
Merged
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
3 changes: 2 additions & 1 deletion pandasai/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"""
import warnings
from typing import List, Optional, Union, Dict, Type
import uuid
import importlib.metadata

import pandas as pd
Expand Down Expand Up @@ -236,7 +237,7 @@ def logs(self) -> List[dict[str, str]]:
return [] if self._dl is None else self._dl.logs

@property
def last_prompt_id(self) -> str:
def last_prompt_id(self) -> uuid.UUID:
"""Return the id of the last prompt that was run."""
return None if self._dl is None else self._dl.last_prompt_id

Expand Down
3 changes: 2 additions & 1 deletion pandasai/smart_dataframe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"""

import hashlib
import uuid
from io import StringIO

import pandas as pd
Expand Down Expand Up @@ -538,7 +539,7 @@ def last_prompt(self):
return self.lake.last_prompt

@property
def last_prompt_id(self) -> str:
def last_prompt_id(self) -> uuid.UUID:
return self.lake.last_prompt_id

@property
Expand Down
2 changes: 1 addition & 1 deletion pandasai/smart_datalake/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ def last_prompt(self):
return self._llm.last_prompt

@property
def last_prompt_id(self) -> str:
def last_prompt_id(self) -> uuid.UUID:
"""Return the id of the last prompt that was run."""
if self._last_prompt_id is None:
raise ValueError("Pandas AI has not been run yet.")
Expand Down