uselotus / lotus

File .deepsource.toml not found in the default branch of the repository root. Please refer to the docs.

Unnecessary generator PTC-W0015
Anti-pattern
Major
a year agoa year old
Unnecessary generator - rewrite as a list comprehension
 351                    key=lambda x: x[1],
 352                    reverse=True,
 353                )[:top_n]
 354                metric_dict["top_n_customers"] = list(x[0] for x in top_n_customers) 355                metric_dict["top_n_customers_usage"] = list(
 356                    x[1] for x in top_n_customers
 357                )
Unnecessary generator - rewrite as a list comprehension
 352                    reverse=True,
 353                )[:top_n]
 354                metric_dict["top_n_customers"] = list(x[0] for x in top_n_customers)
 355                metric_dict["top_n_customers_usage"] = list( 356                    x[1] for x in top_n_customers
 357                )
 358            else:
Unnecessary generator - rewrite as a list comprehension
 64    ## check idempotency
 65    now = now_utc()
 66    now_minus_45_days = now - relativedelta(days=7)
 67    idem_ids = list(x.idempotency_id for x in event_obj_list) 68    repeat_idem = Event.objects.filter(
 69        organization_id=organization,
 70        idempotency_id__in=idem_ids,