Ir al contenido

Missing Query Tag (ARCH2057)

Esta página aún no está disponible en tu idioma.

Key python.orm.missing-query-tag · Severity info · Category orm

Leaving terminal queries without a tag or comment for log/APM correlation makes slow-query attribution harder. Annotate the query with a descriptive tag.

def monthly_report():
return Order.objects.filter(status="paid") # untagged, source unclear in logs
def monthly_report():
return Order.objects.filter(status="paid").annotate(
_tag=RawSQL("/* monthly_report */ 0", [])
)

Add a query tag/comment (TagWith / SQL comment) to terminal queries to ease log and APM correlation.