Skip to content

Commit

Permalink
πŸ§‘β€πŸ’» linting μœ„λ°˜μ‚¬ν•­ μˆ˜μ • (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
mingi3314 authored Feb 18, 2024
1 parent 6b75bbb commit acc15b8
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 11 deletions.
4 changes: 2 additions & 2 deletions pyrb/controllers/api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class AccountResponse(BaseModel):
async def get_default_account(account_service: AccountServiceDep) -> AccountResponse:
try:
account = account_service.get()
except InitializationError:
raise HTTPException(status_code=404, detail="No accounts registered")
except InitializationError as e:
raise HTTPException(status_code=404, detail="No accounts registered") from e

return AccountResponse(account=account)
2 changes: 0 additions & 2 deletions pyrb/repositories/brokerages/base/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@


class PriceFetcher(abc.ABC):
def __init__(self) -> None: ...

@abc.abstractmethod
def get_current_price(self, symbol: str) -> CurrentPrice:
"""νŠΉμ • μ’…λͺ©μ˜ ν˜„μž¬κ°€λ₯Ό μ‘°νšŒν•©λ‹ˆλ‹€.
Expand Down
2 changes: 0 additions & 2 deletions pyrb/repositories/brokerages/base/order_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@


class OrderManager(abc.ABC):
def __init__(self) -> None: ...

@abc.abstractmethod
def place_order(self, order: Order) -> None:
"""
Expand Down
2 changes: 0 additions & 2 deletions pyrb/repositories/brokerages/base/portfolio.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@


class Portfolio(abc.ABC):
def __init__(self) -> None: ...

@property
@abc.abstractmethod
def total_value(self) -> NonNegativeFloat:
Expand Down
4 changes: 2 additions & 2 deletions pyrb/repositories/brokerages/ebest/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ def _issue_access_token(self) -> str:
def _raise_for_status(self, response: Response) -> None:
try:
response.raise_for_status()
except requests.HTTPError:
except requests.HTTPError as e:
# error_code = response.json()["rsp_cd"]
# error_msg = response.json()["rsp_msg"]
status_code = response.status_code
print(response)
raise Exception(f"API client error: {status_code}, {response}")
raise Exception(f"API client error: {status_code}, {response}") from e
2 changes: 1 addition & 1 deletion pyrb/repositories/brokerages/ebest/order_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ def place_order(self, order: Order) -> None:
if resp.get("rsp_cd") != "00040":
raise OrderPlacementError(resp)
except HTTPError as e:
raise OrderPlacementError(e)
raise OrderPlacementError(e) from e

0 comments on commit acc15b8

Please sign in to comment.