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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameError: name 'pl' is not defined #1162

Open
aby1234567 opened this issue May 17, 2024 · 2 comments
Open

NameError: name 'pl' is not defined #1162

aby1234567 opened this issue May 17, 2024 · 2 comments

Comments

@aby1234567
Copy link

System Info

OS version - Windows 11
pandasai version - 2.0.42
python version - 3.11.5

馃悰 Describe the bug

Im trying to use Agent or smartdataframe with polars and this is the issue that i'm getting.

2024-05-17 09:27:55.420 Uncaught app exception
Traceback (most recent call last):
File "C:\Users\aby\anaconda3\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 60
00, in run_script
exec(code, module.dict)
File "C:\Users\aby\Untitled Folder\Streamlit Project\Analyze_with_AI.py", line 77, in
sdf = SmartDataframe(df, config={"llm": llm})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\aby\anaconda3\Lib\site-packages\pandasai\smart_dataframe_init
.py", line 62, in init
self._agent = Agent([df], config=config)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\aby\anaconda3\Lib\site-packages\pandasai\agent\base.py", line 72, in init
dfs = self.get_dfs(dfs)
^^^^^^^^^^^^^^^^^
File "C:\Users\aby\anaconda3\Lib\site-packages\pandasai\agent\base.py", line 211, in get_dfs
connectors.append(PolarsConnector({"original_df": df}))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\aby\anaconda3\Lib\site-packages\pandasai\connectors\polars.py", line 66, in init
self._load_df(self.config.original_df)
File "C:\Users\aby\anaconda3\Lib\site-packages\pandasai\connectors\polars.py", line 76, in _load_df
if isinstance(df, pl.Series):
^^
NameError: name 'pl' is not defined

@gventuri
Copy link
Collaborator

@aby1234567 do you have polars installed?

@aby1234567
Copy link
Author

aby1234567 commented May 20, 2024

@gventuri yes, i have it installed, polars version : 0.20.26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants