isudatateam / datateam

Consider using f-strings PYL-C0209
Performance
Minor
2 days ago3 months old
Formatting a regular string which could be a f-string
45                .execute()
46            )
47        else:
48            print("%s %s" % (item["title"], ",".join(owners)))49
50
51if __name__ == "__main__":
Formatting a regular string which could be a f-string
33    for item in res["items"]:
34        owners = [a["emailAddress"] for a in item["owners"]]
35        if len(owners) == 1 and owners[0] == SA:
36            print("Updating %s" % (item["title"],))37            body = {
38                "value": "[email protected]",
39                "role": "owner",
Formatting a regular string which could be a f-string
29    SA = config["service_account"]
30
31    res = drive.files().list(q="'%s' in owners", maxResults=999).execute()
32    print("Query found %s items" % (len(res["items"]),))33    for item in res["items"]:
34        owners = [a["emailAddress"] for a in item["owners"]]
35        if len(owners) == 1 and owners[0] == SA:
Formatting a regular string which could be a f-string
 76                    for nit in trt["NIT"]:
 77                        for lnd in trt["LND"]:
 78                            for rep in range(1, trt["REPS"] + 1):
 79                                thisID = "%s||%s||%s||%s||%s||%s" % ( 80                                    get_just_code(
 81                                        treatment_names.get(till, "")
 82                                    ),
Formatting a regular string which could be a f-string
 53            for key in row:
 54                if row[key] is None:
 55                    row[key] = ""
 56            key = "%s||%s||%s||%s||%s||%s" % ( 57                get_just_code(row.get("tillage").strip()),
 58                get_just_code(row.get("rotation").strip()),
 59                get_just_code(row.get("nitrogen").strip()),