alpacahq / alpaca-py

The Official Python SDK for Alpaca API
https://alpaca.markets/sdks/python/getting_started.html
Apache License 2.0
537 stars 134 forks source link

fix: optional fields in FailedClosePositionDetails #360

Closed alessiocastrica closed 11 months ago

alessiocastrica commented 11 months ago

@AlexandrosKyriakakis sure, basically when we get a response on a failed order without additional fields (only including error code and message) pydantic validation for FailedClosePositionDetails will fail as those fields were not marked as optional. We can huddle about it if you want more context. image

alessiocastrica commented 11 months ago

and a minor fix I added was the fact that cancel_orders should be optional in the method as it's an optional query parameter