Passage of the 2018 farm bill, which President Donald Trump is expected to sign soon, is an important and welcome development for farmers, who have been buffeted by trade wars, falling commodity prices and generally uncertain futures.

After languishing so long in gridlock that some had nearly given up hope of a resolution this year, the bill roared back to life after both sides agreed to drop increased work requirements for nutrition assistance programs that had divided lawmakers and make other changes, such as legalizing hemp, that won votes.

Minnesota Rep. Collin Peterson, ranking member on the House Agriculture Committee and the incoming chairman in next year's Democratic-led House, credited passage to the hard work done "to turn a partisan bill into a bipartisan bill. That's the way Congress is supposed to work." Among the improvements: provisions to reduce inaccurate payments and slightly increase funding for work training in connection with SNAP, the Supplemental Nutrition Assistance Program that replaced food stamps.

Peterson is right; that is the way Congress should work. But it shouldn't take until the 11th hour of a lame-duck session for lawmakers to have the courage to work through their differences and compromise on a bill that mostly reauthorizes existing agriculture programs and food aid depended upon by nearly 40 million low-income Americans.

The major sticking point was an insistence by House Republicans that work requirements — which already exist in the SNAP program — be increased, age limits raised and exemptions reduced. There was no real need for the provision, since states for decades have had the authority to raise work requirements on their own. Little evidence was presented as to the effectiveness or necessity of tougher requirements, and House Democrats, along with the narrowly divided Senate, stood firmly against them, sparing thousands of families who otherwise might have lost eligibility.

The bill includes additional supports for dairy farmers, permanent funding for farmers markets and greater flexibility on some programs that will assist other farmers, Peterson said — another welcome bit of relief to farmers who are facing strong economic headwinds. Peterson and others have expressed concerns that some farms could fail to qualify for the bank loans they need to put in next year's crops. The farm bill "doesn't provide enough help for some of them to avoid that," Peterson said, "but hopefully it makes things a little easier for some of them."

There was another notable change to the $867 billion bill that could set the stage for the widespread reintroduction of a crop once common in the U.S. — hemp, a form of cannabis. After decades of debate, hemp will become a legal agricultural commodity and will be removed from the federal controlled substances list. That does not mean marijuana has been legalized. It does, however, mean a potential explosion in the cannabinoid industry.

Hundreds of millions of dollars of goods made with hemp — everything from hand lotion to teas and supplements — are sold in the U.S., but rely on imported hemp and hemp by-products. That's been a boon for Canada, where hemp is already legal. Hemp could have strong potential in Minnesota, which participates in a pilot hemp program that was authorized in the 2014 farm bill. There are only 710 acres planted with hemp, according to state statistics, but that has the potential to expand greatly. Already there are estimates that the U.S. cannabis industry could go from $800 million now to $20 billion within four years.

That's a substantial improvement, and one that shows when lawmakers forgo gridlock for compromise, they can wind up with a better product.