Find answers from the community

Updated 5 months ago

Hi, I'm working with an log analysis

Hi, I'm working with an log analysis project. I executed this query : "What is the operationName done on 10-07-2024?" using the Pandas query engine, with the llm 35-turbo in Azure. When I execute this it works great in jupyter notebook, but when i execute this same query on same data using a .py script it starts throwing errs why? the err faced is: raise AttributeError("Can only use .dt accessor with datetimelike values") AttributeError: Can only use .dt accessor with datetimelike values There seems to be an error with the query results. Please check the code and try again.
W
N
11 comments
maybe check if the lib versions are same or not.
same environment bro
Can we connect? And rectify this ? Pls
this is the py notebook below, for which the output is generated as expected
If we execute the same lines of code in .py script below like in this script. I'm getting invalid key error since the model is trying to access some column from df which isnt' available. If the key that model needs is Time (as in csv) the model is trying to access it using 'Time Generated'.
As in the code below, Inorder to overcome this, I had to add some additional lines of code for adding pandas prompt template as well as instruction set for the pandas query engine. But in the notebook it isn't ncessary at all, After adding these code, I'm getting correct output for this query: "What is the timestamp for the earliest and latest log entry?" Which was not working without these pandas prompt and instruction set. But this query is not working: "List all the operation names done on 10-07-2024?". It throws an error:
raise AttributeError("Can only use .dt accessor with datetimelike values")
AttributeError: Can only use .dt accessor with datetimelike values
I'm sorry, but there was an error running the query. It seems that the code is unable to use the .dt accessor with the given values. Please check the input and try again.

FYI: All these queries are working fine in jupyter notebook even without the pandas prompt and instruction set.
the requirements file.
It should not happen though if you are using the same env tbh.
yeah, but its happening
Should i raise my above issue in github issues and in the py-issues discussion ?
Add a reply
Sign up and join the conversation on Discord