U.S. President Donald Trump and Chinese President Xi Jinping during the plenary session at the G20 Summit on July 7, 2017 in Hamburg, Germany.

Trade tensions between the world's two largest economies are heating up ahead of President Donald Trump's visit to Beijing, with the American leader calling the U.S. trade deficit with China "embarrassing" and "horrible" on Wednesday.

The comments follow trade-related disputes in the last week, highlighting friction between the two economic giants as they prepare to go to the negotiating table. There's just one problem: North Korea.

"The key priority for the U.S. is to maintain good economic relations with China since the U.S. wants to strengthen joint co-operation with China to tackle the key geopolitical threat from North Korea's aggressive development of its nuclear weapons and ballistic missiles program," Rajiv Biswas, chief economist for Asia Pacific at IHS Markit, told CNBC.

That is why the U.S. has avoided taking "harsh trade measures" against China, he added.

But there still have been some actions against Asia's largest economy.

Last weekend, the Commerce Department acted on aluminum foil, on Chinese imports. Beijing responded swiftly and strongly, saying it was "strongly dissatisfied" with a U.S. decision that was based on a "serious distortion" of facts.

Still, selective duties like that are not the same as "blunt bilateral trade measures that could endanger the overall bilateral geopolitical relationship with China," Biswas added.