0

This started after I updated my data science libraries to the latest version. Now I get his error after running any of the queries I was running before, but I'm not completly certain from which library or function this is coming from? How can I know which is the compatible version? What should I do if the problem is something else?

%pip install --upgrade pip
%pip install --upgrade pandas openpyxl
%pip install --upgrade pandasql
%pip install --upgrade bamboolib matplotlib seaborn
%pip install --upgrade numpy scikit-learn ipython mlflow

And some of the code I'm using:

"""
    SELECT NomeConta, julianday(DATE('now')) - julianday(DtCriacaoConta) idadeConta 
    FROM df_usuarios
    GROUP BY NomeConta
"""

If it's a version and dependency problem, I don't think ChatGPT is going to help me with this one.

  • Please include the full error traceback message, as well as your library version details, in your post. – AlexK Mar 28 '23 at 21:08

1 Answers1

0

This behavior is coming from Pandasql. There seems to be a bug in sqlalchemy which is used within Pandasql to process query strings. The sqlalchemy bug is documented here: https://github.com/pandas-dev/pandas/issues/51061

and an answer for this problem with worked for me is here:

Error while querying pandas dataframe using pysqldf function

mried
  • 16
  • 2
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 09 '23 at 07:09