Skip to content
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

Example code error on Heroku #24

Open
jiaqixu opened this issue Aug 13, 2019 · 0 comments
Open

Example code error on Heroku #24

jiaqixu opened this issue Aug 13, 2019 · 0 comments

Comments

@jiaqixu
Copy link

jiaqixu commented Aug 13, 2019

I use the latest version of alpaca-trade-api (I have seen issue #12 and #15), it runs fine in local machine while still get error on Heroku

2019-08-13T17:27:46.655181+00:00 app[worker.1]: File "main.py", line 5, in
2019-08-13T17:27:46.655297+00:00 app[worker.1]: algo.main()
2019-08-13T17:27:46.655301+00:00 app[worker.1]: File "/app/samplealgo/algo.py", line 209, in main
2019-08-13T17:27:46.655453+00:00 app[worker.1]: price_df = prices(Universe)
2019-08-13T17:27:46.655456+00:00 app[worker.1]: File "/app/samplealgo/algo.py", line 61, in prices
2019-08-13T17:27:46.655570+00:00 app[worker.1]: return _get_prices(symbols, end_dt)
2019-08-13T17:27:46.655573+00:00 app[worker.1]: File "/app/samplealgo/algo.py", line 51, in _get_prices
2019-08-13T17:27:46.655683+00:00 app[worker.1]: return barset.df
2019-08-13T17:27:46.655686+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/alpaca_trade_api/entity.py", line 102, in df
2019-08-13T17:27:46.655808+00:00 app[worker.1]: df = bars.df.copy()
2019-08-13T17:27:46.655811+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/alpaca_trade_api/entity.py", line 84, in df
2019-08-13T17:27:46.655926+00:00 app[worker.1]: df.index * 1e9, utc=True,
2019-08-13T17:27:46.655929+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/pandas/util/_decorators.py", line 208, in wrapper
2019-08-13T17:27:46.656074+00:00 app[worker.1]: return func(*args, **kwargs)
2019-08-13T17:27:46.656077+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/pandas/core/tools/datetimes.py", line 785, in to_datetime
2019-08-13T17:27:46.656397+00:00 app[worker.1]: result = convert_listlike(arg, box, format)
2019-08-13T17:27:46.656401+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/pandas/core/tools/datetimes.py", line 374, in _convert_listlike_datetimes
2019-08-13T17:27:46.656634+00:00 app[worker.1]: arg, _ = maybe_convert_dtype(arg, copy=False)
2019-08-13T17:27:46.656639+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/pandas/core/arrays/datetimes.py", line 2032, in maybe_convert_dtype
2019-08-13T17:27:46.657262+00:00 app[worker.1]: data = data.astype(_NS_DTYPE)
2019-08-13T17:27:46.657266+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/pandas/core/indexes/numeric.py", line 369, in astype
2019-08-13T17:27:46.657472+00:00 app[worker.1]: raise TypeError(msg)
2019-08-13T17:27:46.657492+00:00 app[worker.1]: TypeError: Cannot convert Float64Index to dtype datetime64[ns]; integer values are required for conversion

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

No branches or pull requests

1 participant