You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I input question related to date time, it will generate code using datetime library, but it often encounters this error. I guess sometimes it will confuse between import datetime and from datetime import datetime?
AttributeError: type object 'datetime.datetime' has no attribute 'datetime'
To resolve the AttributeError: type object 'datetime.datetime' has no attribute 'datetime' error, ensure that you are correctly importing and using the datetime module. The correct way to import and use the datetime module is as follows:
Make sure you are not using datetime.datetime.datetime, which would cause the AttributeError. The correct usage is datetime.datetime.
In your generated code, the import statement is correct, but double-check that there are no conflicting imports or incorrect usages elsewhere in your code. Here is the corrected version of your generated code:
System Info
pandasai version 2.0.42
馃悰 Describe the bug
When I input question related to date time, it will generate code using datetime library, but it often encounters this error. I guess sometimes it will confuse between import datetime and from datetime import datetime?
AttributeError: type object 'datetime.datetime' has no attribute 'datetime'
[INFO] Code generated:
[INFO] Executing Step 2: CodeCleaning
[INFO] Code running:
The text was updated successfully, but these errors were encountered: