Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

NameError: name 'F' is not defined #44

Open
bwright3rl opened this issue May 25, 2023 · 0 comments
Open

NameError: name 'F' is not defined #44

bwright3rl opened this issue May 25, 2023 · 0 comments

Comments

@bwright3rl
Copy link

I am trying to run a Spark Dataframe agent to query tabular data. With certain operations the agent decides it needs to import the pyspark.sql.functions package. The agent runs the following code
from pyspark.sql.functions import *
and then on the following iteration tries running
df.groupBy('product_department_desc').agg(F.sum('product_qty').alias('total_qty')).sort(F.desc('total_qty')).show()
This fails with the error 'name 'F' is not defined' because the alias is not set as F in the previous iteration. However the agent then gets stuck in an infinite loop and times out after max iterations.
Is this a bug, or is this something I should try and fix with a custom prompt template?
Thanks!!

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

No branches or pull requests

1 participant