gerrymanoim / exchange_calendars

Calendars for various securities exchanges.
Apache License 2.0
396 stars 129 forks source link

Getting AttributeError: 'NoneType' object has no attribute 'total_seconds' requesting calendar for XNYS #397

Open chadale opened 2 weeks ago

chadale commented 2 weeks ago

following code (jupyterhub notebook):

import pandas as pd import numpy as np from datetime import datetime, date, timedelta import exchange_calendars as xcals xnys = xcals.get_calendar('XNYS')

Get following error: AttributeError: 'NoneType' object has no attribute 'total_seconds'

Full trace in file attached.

CalendarErrors.txt

maread99 commented 1 week ago

Hi @chadale, I'm unable to replicate this error. If you're not already using the latest version of exchange_calendars(?) could you try upgrading and see if that fixes it. If that doesn't work then I'd suggest upgrading the dependencies to the latest versions. Let us know if none of that does the trick.