Or use atom smashers.
1) Dig a room below the flooded room.
2) Build a raising bridge in this lower room.
3) hook it up to an accessible lever.
4a) Either dig a hole upward from there to the farm room,
or
4b) Dig a hole into the tunnel that leads into your farm from the water source.
5) Set the lever to be pulled on repeat (q->a->P->r).
(4a) is if you have something in place to block more water from flowing into the farm, like a door or floodgate. (4b) is if you don't. In that case, you divert the water from its source into your atom smasher room, then wall off or put a floodgate over the hole to keep the water out.
The atom smasher is a reliable, quick, and easy to implement method for eliminating any amount of fluid. Use a decent sized bridge, like 5x5 or even the full 10x10, to make sure you get a good rate of elimination.
make a shaft below the stream that goes down to a rock layer, make a tunnel from that to the nearest edge of the map, smooth and fortify the map edge tiles so the water can get out, put in some flood gates, breach the bed of the river so it flows into the shaft, through the tunnel, and out the fortifications... if you make the shaft cover the width of the stream and use a cavein to breach the entire river bed, no water should flow past where you breached it.
Doesn't always work. Sometimes water comes out of map edges, sometimes it goes in.