Skip to content

Commit

Permalink
fix: workaround for doc check
Browse files Browse the repository at this point in the history
  • Loading branch information
alessiocastrica committed Oct 6, 2023
1 parent eb03074 commit fe912a9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 23 deletions.
22 changes: 1 addition & 21 deletions alpaca/common/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import json
from typing import Any, Dict, List, Optional, Union
from typing import Any, Dict, List, Union
from pydantic import BaseModel, TypeAdapter, ValidationError
from requests.exceptions import HTTPError
from requests import Request, Response
from enum import Enum


class ErrorBody(BaseModel):
Expand All @@ -18,17 +17,6 @@ class ErrorBody(BaseModel):
class PDTErrorBody(ErrorBody):
"""
Represent the body of the API error in case of PDT.
Example:
{
"code":40310000,
"day_trading_buying_power":"43251.29",
"max_dtbp_used":"43370.52",
"max_dtbp_used_so_far":"12805.28",
"message":"day trading margin call protection",
"open_orders":"283",
"symbol":"AAPL"
}
"""

day_trading_buying_power: float
Expand All @@ -41,14 +29,6 @@ class PDTErrorBody(ErrorBody):
class BuyingPowerErrorBody(ErrorBody):
"""
Represent the body of the API error in case of insufficient buying power.
Example:
{
"buying_power": "0",
"code": 40310000,
"cost_basis": "1",
"message": "insufficient buying power"
}
"""

buying_power: float
Expand Down
5 changes: 4 additions & 1 deletion alpaca/common/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pydantic import BaseModel
from pydantic import BaseModel, ConfigDict
import pprint


Expand All @@ -8,5 +8,8 @@ class ValidateBaseModel(BaseModel, validate_assignment=True):
it or forget to specify it in our models where we want assignment validation
"""

# ignoring the ('model_',) protected namespace may temporarly fix the docs build
model_config = ConfigDict(protected_namespaces=tuple())

def __repr__(self):
return pprint.pformat(self.model_dump(), indent=4)
1 change: 0 additions & 1 deletion alpaca/data/models/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import itertools
import pprint
from typing import Any, Dict, List

import pandas as pd
Expand Down

0 comments on commit fe912a9

Please sign in to comment.