From e3ad16e378f0453162cdce133d1ff8fffd73da9e Mon Sep 17 00:00:00 2001 From: alessiocastrica Date: Tue, 10 Oct 2023 08:39:21 +0200 Subject: [PATCH] fix: comments --- alpaca/broker/client.py | 7 ++++--- alpaca/common/models.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/alpaca/broker/client.py b/alpaca/broker/client.py index 9d6a0e6b..022ebe53 100644 --- a/alpaca/broker/client.py +++ b/alpaca/broker/client.py @@ -524,9 +524,10 @@ def _get_account_activities_iterator( # ok we made it to the end, we need to ask for the next page of results last_result = result[-1] - assert ( - "id" in last_result - ), "AccountActivity didn't contain an `id` field to use for paginating results" + if "id" not in last_result: + raise AssertionError( + "AccountActivity didn't contain an `id` field to use for paginating results" + ) # set the pake token to the id of the last activity so we can get the next page request_fields["page_token"] = last_result["id"] diff --git a/alpaca/common/models.py b/alpaca/common/models.py index 1102dbd8..8d734c7c 100644 --- a/alpaca/common/models.py +++ b/alpaca/common/models.py @@ -1,4 +1,4 @@ -from pydantic import BaseModel, ConfigDict +from pydantic import BaseModel import pprint