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

_format_native_types #1385

Open
Chris-Keo opened this issue Oct 7, 2024 · 6 comments
Open

_format_native_types #1385

Chris-Keo opened this issue Oct 7, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@Chris-Keo
Copy link

System Info

pandasai==2.2.15
python==3.10

🐛 Describe the bug

I get this error over and over, even when downgrading pandas as it prompted.

This is using the example code on the documatation.

'Index' object has no attribute '_format_native_types'

2024-10-06 23:23:42 [INFO] Executing Step 0: ValidatePipelineInput
2024-10-06 23:23:42 [INFO] Executing Step 1: CacheLookup
2024-10-06 23:23:42 [INFO] Executing Step 2: PromptGeneration
2024-10-06 23:23:42 [ERROR] Pipeline failed on step 2: 'Index' object has no attribute '_format_native_types'

Copy link

dosubot bot commented Oct 7, 2024

Hey there, @Chris-Keo! I'm here to help you with any bugs, questions, or contributions you have. Let's tackle this issue together!

The error message you're encountering, "'Index' object has no attribute '_format_native_types'", suggests that there might be an issue with the version compatibility between pandas-ai and the pandas library. The _format_native_types method is not a standard method for Index objects in pandas, which might indicate that the code is trying to access a non-existent method.

Here are a few steps you can take to troubleshoot and potentially resolve this issue:

  1. Check Pandas Version: Ensure that you are using the correct version of pandas that is compatible with pandas-ai 2.2.15. According to the dependencies for pandas-ai 2.2.15, it requires pandas version 1.5.3 [1].

  2. Review Code: If you have access to the code, check if there are any custom implementations or extensions that might be incorrectly trying to access _format_native_types on an Index object.

  3. Update Libraries: Make sure all your libraries are up to date, especially pandas-ai and pandas. Sometimes, bugs are fixed in newer releases.

  4. Example Code: If the error occurs with example code from the documentation, double-check the example to ensure it matches the current version of the library.

If these steps do not resolve the issue, it might be helpful to look for any recent updates or discussions in the pandas-ai repository that might address this problem.

To continue talking to Dosu, mention @dosu.

@dosubot dosubot bot added the bug Something isn't working label Oct 7, 2024
@Chris-Keo
Copy link
Author

Chris-Keo commented Oct 7, 2024

I did all of that and i was using the the example dataframes from the docs.

@dosu

@Adityashinde1
Copy link

@Chris-Keo
SmartDataframe(df, config={"llm": llm})
in the above code please check that you are providing df as a dataframe and not a dataframe name. let me know

Copy link

dosubot bot commented Oct 14, 2024

If you've already tried those steps and are still encountering the issue, it might be worth checking if there are any known issues or bug reports related to the _format_native_types error in the pandas-ai GitHub repository. Unfortunately, I couldn't find specific information about this error in the repository [1].

As a next step, consider verifying if there have been any recent changes or updates in the pandas-ai codebase that might affect compatibility with pandas or the usage of _format_native_types. If the problem persists, you might want to explore alternative solutions or workarounds, such as modifying the example code to avoid the problematic method call, if possible.

To continue talking to Dosu, mention @dosu.

@iara0802
Copy link

iara0802 commented Dec 4, 2024

Im having the exact same issue. Still waiting for a solution :c

@Chris-Keo
Copy link
Author

I'd just look for another library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants