Investors may want to be more selective when it comes to stocks with high dividend yields, according to Piper Sandler. The warning comes amid an earnings season that has been marked by solid results from megacap technology companies. Yet, Piper points out that small- and midcap reports have been "lackluster at best," seeing no trace of a broad-based recovery.

Not only that, the labor market has been cooling, with July's nonfarm payrolls report showing the unemployment rate rising to 4.3%. "In this backdrop of bifurcated earnings and a deteriorating labor market, it is especially important to consider the sustainability of dividend payments," the firm wrote in a Tuesday note to clients.

"Not all stocks with a high dividend yield are high quality." With this in mind, Piper looked through the S & P 500 dividend payers to see which stocks could be at risk of seeing a dividend cut. To gauge this, the firm used the following formula: cash flow minus preferred dividends minus capital expenditures divided by common dividends.

If that "ability-to-sustain ratio" is less than 1, Piper considers it "concerning." Here are a few names in the screen to watch out for: Walgreens Boots Alliance made the list of concerning names. The pharmaceutical chain has the highest dividend yield on the list at 9.

4%. However, its ability-to-sustain ratio is well below than the greater-than-one threshold. Shares have plunged more than 60% this year.

Walgreens also saw its worst day on record on June 27, whe.