I wonder if I have correctly used the phrase "such as" in the following sentence?
The abrupt changes in weather patterns such as prolonged heatwaves and days of heavy rain are the onset symptoms of climate change.
Is it correct? Do I need to put it between commas like this?
The abrupt changes in weather patterns, such as prolonged heatwaves and days of heavy rain, are the onset symptoms of climate change.