def METHOD_NAME(query):
    bill_of_entry = frappe.qb.DocType("Bill of Entry")
    purchase_invoice = frappe.qb.DocType("Purchase Invoice")
    return (
        query.left_join(purchase_invoice)
        .on(purchase_invoice.name == bill_of_entry.purchase_invoice)
        .select(
            purchase_invoice.supplier,
        )
    )