-
Notifications
You must be signed in to change notification settings - Fork 138
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
AttributeError: 'datetime.timezone' object has no attribute 'key' in calendar_helpers.py
#408
Comments
Hi @gmaubach, sorry for the late reply. This doesn't appear to be an issue with Looking at the traceback, I'm wondering if it might not be as simple as needing to define your 'start' and 'end' values without a time component. I'd try that, again with timezone-naive values, for example: import datetime
start = datetime.datetime(2018, 12, 31) Let us know if that doesn't fix it. |
I don't think that is the correct way to deal with this. As I say here stefan-jansen/zipline-reloaded#265 I think this is a bug in Zipline. Would like to get your feedback because I'd like to fix this. |
Hi @jimwhite. Sorry but I can't offer any worthwhile insight on the zipline issue - I'm not familiar with the package. |
Description
I encountered an
AttributeError
while using theexchange_calendars
library. The error occurs in theparse_date
function incalendar_helpers.py
.Expected Behaviour
The time-ware date should be parsed without any errors.
Actual Behaviour
An
AttributeError
is raised indicating that'datetime.timezone' object has no attribute 'key'
.Environment
OS: Debian GNU Linux 12 Bookworm
Build: Linux version 6.1.0-23-amd64 ([email protected]) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian 6.1.99-1 (2024-07-15)
Package Management: conda (Minoconda3 Python 3.10)
Environment: see attached environment.yml file named "environment_yml.txt"
Python: 3.10.13
Module Version: exchange-calendars=4.5.5=pyhd8ed1ab_0
Steps to Reproduce
Version with timezone-aware dates
Source
Traceback
Version with time-unaware dates
Source
Traceback
Attachments
environment_yml.txt
The text was updated successfully, but these errors were encountered: