The only gas one may politely pass in public is gasoline (and then only if it's in a container). However, it's definitely polite to pass a joint in public.
I think it may be impolite to do it silently. Like if you choose to do that in public I think you should try to make it as loud as possible and also raise your hand so as to give a heads up to the other shoppers around you so that they know the deal. That's respect. : )