Comments (8)
released https://github.com/alpacahq/alpaca-py/releases/tag/v0.13.1.
Can you please try to use the new version?
edit: sorry, missed to bump versions. so should be v0.13.1
from alpaca-py.
from alpaca-py.
+1. Was about to post this as well. Here's the issue I'm getting:
10/26/23 01:47:15 AM
2023-10-26 05:47:15,041: alpaca.trading.stream: ERROR: error during websocket communication: 3 validation errors for TradeUpdate
10/26/23 01:47:15 AM
position_qty
10/26/23 01:47:15 AM
Field required [type=missing, input_value={'event': 'new', 'timesta...4a04-a508-1ba63cfc3150'}, input_type=dict]
10/26/23 01:47:15 AM
For further information visit https://errors.pydantic.dev/2.4/v/missing
10/26/23 01:47:15 AM
price
10/26/23 01:47:15 AM
Field required [type=missing, input_value={'event': 'new', 'timesta...4a04-a508-1ba63cfc3150'}, input_type=dict]
10/26/23 01:47:15 AM
For further information visit https://errors.pydantic.dev/2.4/v/missing
10/26/23 01:47:15 AM
qty
10/26/23 01:47:15 AM
Field required [type=missing, input_value={'event': 'new', 'timesta...4a04-a508-1ba63cfc3150'}, input_type=dict]
10/26/23 01:47:15 AM
For further information visit https://errors.pydantic.dev/2.4/v/missing
10/26/23 01:47:15 AM
Traceback (most recent call last):
10/26/23 01:47:15 AM
File "/home/runner/2be35c55-ea57-4c2f-9ba0-c48797fbc552/venv/lib/python3.10/site-packages/alpaca/trading/stream.py", line 172, in _run_forever
10/26/23 01:47:15 AM
await self._consume()
10/26/23 01:47:15 AM
File "/home/runner/2be35c55-ea57-4c2f-9ba0-c48797fbc552/venv/lib/python3.10/site-packages/alpaca/trading/stream.py", line 145, in _consume
10/26/23 01:47:15 AM
await self._dispatch(msg)
10/26/23 01:47:15 AM
File "/home/runner/2be35c55-ea57-4c2f-9ba0-c48797fbc552/venv/lib/python3.10/site-packages/alpaca/trading/stream.py", line 89, in _dispatch
10/26/23 01:47:15 AM
await self._trade_updates_handler(self._cast(msg))
10/26/23 01:47:15 AM
File "/home/runner/2be35c55-ea57-4c2f-9ba0-c48797fbc552/venv/lib/python3.10/site-packages/alpaca/trading/stream.py", line 103, in _cast
10/26/23 01:47:15 AM
result = TradeUpdate(**msg.get("data"))
10/26/23 01:47:15 AM
File "/home/runner/2be35c55-ea57-4c2f-9ba0-c48797fbc552/venv/lib/python3.10/site-packages/pydantic/main.py", line 164, in __init__
10/26/23 01:47:15 AM
__pydantic_self__.__pydantic_validator__.validate_python(data, self_instance=__pydantic_self__)
10/26/23 01:47:15 AM
pydantic_core._pydantic_core.ValidationError: 3 validation errors for TradeUpdate
10/26/23 01:47:15 AM
position_qty
10/26/23 01:47:15 AM
Field required [type=missing, input_value={'event': 'new', 'timesta...4a04-a508-1ba63cfc3150'}, input_type=dict]
10/26/23 01:47:15 AM
For further information visit https://errors.pydantic.dev/2.4/v/missing
10/26/23 01:47:15 AM
price
10/26/23 01:47:15 AM
Field required [type=missing, input_value={'event': 'new', 'timesta...4a04-a508-1ba63cfc3150'}, input_type=dict]
10/26/23 01:47:15 AM
For further information visit https://errors.pydantic.dev/2.4/v/missing
10/26/23 01:47:15 AM
qty
10/26/23 01:47:15 AM
Field required [type=missing, input_value={'event': 'new', 'timesta...4a04-a508-1ba63cfc3150'}, input_type=dict]
from alpaca-py.
Thank you for the reporting and sorry for the inconvenience.
Just created a PR to solve this issue.
#372
from alpaca-py.
Now it works just fine (with v0.13.0+), no more pydantic validation errors on events
Thnx!
from alpaca-py.
I am going to update my code for use raw_data=True
because this pydantic nonsense will always be susceptible to breakage for the slightest reasons.
from alpaca-py.
I am going to update my code for use
raw_data=True
because this pydantic nonsense will always be susceptible to breakage for the slightest reasons.
Yea that sounds like a good idea, I really dislike pydantic. Where exactly are you putting raw_data=True?
from alpaca-py.
Where exactly are you putting
raw_data=True
?
It can be specified as a kwarg when initializing an instance of the TradingStream
class. Its default value is False.
from alpaca-py.
Related Issues (20)
- [Question]: How to understand the number of API calls I'm making?
- [Bug]: Paper API - quantity in opened position is not the same as requested in market order HOT 1
- Can you download documents? HOT 3
- [Bug]: Data WebSocket Error: Restarting Connection Due to Server Rejected WebSocket Connection (HTTP 404) HOT 7
- [Bug]: Websockets conflict HOT 2
- Fix link of docs in repo page HOT 1
- [Question]: How to get hourly historical data starting from 9:30am (NY time)? HOT 1
- light edit for docs
- [Bug]: Order stuck in pending_cancel
- [Bug]: potentially unnecessary parameter is required when submitting OCO orders
- [Bug]: PydanticUserError: If you use `@root_validator` with pre=False (the default) you MUST specify `skip_on_failure=True`. Note that `@root_validator` is deprecated and should be replaced with `@model_validator`. HOT 2
- [Bug]: HOT 1
- [Bug]: Unable to execute ReplaceOrderRequest on a stop loss order HOT 1
- Support REST requests timeout, especially with StockHistoricalDataClient
- [Bug]: Duplicate Indicies HOT 3
- [Bug]: The option data stream should not have subscribe bar method
- APIError should make message more readily available to end users HOT 1
- Client should *not* un-paginate large results. Should return a `generator` that does this for you. HOT 1
- [Bug]: TradeAccount validation error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alpaca-py.