Leases - Supplemental Cash Flow and Other Information (Details) - USD ($)
$ in Thousands
3 Months Ended 6 Months Ended
Jan. 31, 2022
Jan. 31, 2021
Jan. 31, 2022
Jan. 31, 2021
Leases [Abstract]        
Operating cash flows from operating leases $ 12,081 $ 12,398 $ 25,557 $ 22,374
Financing cash flows from finance leases 104 323
Lease liabilities arising from obtaining right-of-use assets from operating leases 3,620 3,950 13,538
Lease liabilities arising from obtaining right-of-use assets from finance leases $ 3,873 $ 3,873