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

πŸ§‘β€πŸ’» linting μœ„λ°˜μ‚¬ν•­ μˆ˜μ • #84

Merged
merged 1 commit into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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