There was an article in National Geographic maybe a year ago which explained how one could purify water simply by putting it in a certain type of plastic bottle and leave it sealed and undisturbed, in the Sun for a day.
I think it would be OK but I personally would filter it first.
Don’t conflate removing stuff from water vs. killing stuff living in water.
UV light is good at killing microorganisms. Sunlight is sufficient, given a container transparent to UV and enough time for that level of UV to do the job.
The “straw” in question is a filter for removing particles from water, enough to strip out bacteria but not much smaller viruses.
Use both when possible.
Filter out what you can, then use UV to kill anything that got thru the filter.
I’m surprised nobody has made a combination filter & purifier in a single personal water bottle. Ceramic filter used when pumping water into the bottle, UV light for once filled, would be nice.