Skip to content

Commit f583804

Browse files
committed
Replaced assertion with if statement
1 parent 3429c21 commit f583804

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

awswrangler/cloudwatch.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -431,10 +431,9 @@ def filter_log_events(
431431
describe_log_streams_args["boto3_session"] = boto3_session
432432
if log_stream_name_prefix:
433433
describe_log_streams_args["log_stream_name_prefix"] = log_stream_name_prefix
434-
log_stream_names = describe_log_streams(
435-
log_group_name=log_group_name, log_stream_name_prefix=log_stream_name_prefix, boto3_session=boto3_session
436-
)["logStreamName"].tolist()
437-
assert log_stream_names is not None
434+
log_streams = describe_log_streams(**describe_log_streams_args)
435+
log_stream_names = log_streams["logStreamName"].tolist() if len(log_streams.index) else []
436+
438437
args: Dict[str, Any] = {
439438
"log_group_name": log_group_name,
440439
}

0 commit comments

Comments
 (0)