Skip to content

Commit

Permalink
fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
adba-msft committed Jan 25, 2024
1 parent 2ec2e81 commit 442fd0f
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
class ScoringClient:
"""Scoring client."""


def __init__(
self,
header_handler: OpenAIHeaderHandler,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ async def score_once(
worker_id: str = "1"
) -> ScoringResult:
"""Score a single request until terminal status is reached."""

# Timeout can be None. See `timeout_utils.get_next_retry_timeout` for more info on why.
if timeout is None:
timeout = session.timeout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

MINIMUM_SCORING_TIMEOUT = 10


def get_next_retry_timeout(timeout_generator):
"""Get next retry timeout."""
try:
Expand All @@ -36,4 +37,4 @@ def get_retry_timeout_generator(default_timeout: aiohttp.ClientTimeout):

def _get_initial_request_timeout():
return int(os.environ.get(constants.BATCH_SCORE_INITIAL_REQUEST_TIMEOUT_ENV_VAR)
or MINIMUM_SCORING_TIMEOUT)
or MINIMUM_SCORING_TIMEOUT)
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ def mock_post(**kwargs):
await scoring_client.score_once(session=session, scoring_request=MagicMock(), timeout=MagicMock())

assert 'Score failed' in caplog.text
assert type(exception_to_raise).__name__ in caplog.text
assert type(exception_to_raise).__name__ in caplog.text
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_get_next_retry_timeout(time, expected_iters):

# Act
for i in range(expected_iters):
timeout = timeout_utils.get_next_retry_timeout(timeout_generator)
timeout_utils.get_next_retry_timeout(timeout_generator)

# Assert
assert timeout_utils.get_next_retry_timeout(timeout_generator) is None
Expand Down

0 comments on commit 442fd0f

Please sign in to comment.