State Senator Scott Wiener, a San Francisco Democrat, argued that the 2018 federal Farm Bill created a loophole in the law.