This article first appeared on GuruFocus.

Chewy (NYSE:CHWY) heads into its September 9 earnings report with Bank of America arguing that the beaten-down pet retailer may be approaching a better setup than its stock price suggests.

BofA analyst Michael McGovern reiterated a Buy rating and $31 price target, pointing to improving pet-industry spending trends and continued opportunities for Chewy to expand margins through advertising, healthcare services and automation.

Warning! GuruFocus has detected 2 Warning Sign with CHWY.

Is CHWY fairly valued? Test your thesis with our free DCF calculator.

Net/net, we remain constructive on steady compounding earnings growth driven by margin expansion from ads, Health/CVC, & automation/AI, McGovern said.

The bullish call comes after a difficult year for shareholders. Chewy stock has fallen roughly 27% year to date, hurt by a full-year guidance reduction in June and concerns that consumer uncertainty could slow discretionary pet spending.

Wall Street expects fiscal Q2 earnings of $0.18 per share, representing roughly 29% year-over-year growth, on revenue of about $3.32 billion, up approximately 7.1%.

Bank of America sees some encouraging signs underneath those estimates.

The bank's credit- and debit-card data showed pet-industry spending growth accelerating from roughly 1% in Q2 to 2% in July. Separate Second Measure data also indicated improving momentum during July, potentially giving Chewy a better backdrop heading into the quarter.

That matters because investor sentiment has become increasingly divided. Bulls expect pet demand to recover as household formation and premiumization improve, while bears remain focused on slower sales growth and Chewy's market-share trajectory.

McGovern argues the recent valuation reset reflects macroeconomic weakness more than deterioration in Chewy's competitive position.

The September 9 report will largely come down to whether improving category data is beginning to show up in Chewy's actual results.

Investors should watch net sales growth, active customers, Autoship penetration and gross margin, along with management's full-year outlook.

Margin expansion may prove especially important. If advertising, healthcare and automation allow earnings to grow faster than revenue, Chewy could continue compounding profits even while the broader pet category remains subdued.

But another guidance reduction or signs of further market-share pressure would reinforce the bear case.

For now, Bank of America is betting that Chewy's 27% decline has created a more attractive entry point just as industry demand begins showing early signs of improvement.