MILWAUKEE >> The Midwest weather was beautiful this week. But when it rained, it seemed to pour.

The Giants failed to complete a four-game sweep of the Milwaukee Brewers, losing 7-5, after falling in too deep of an early hole for the second time this trip. All of their other five contests ended in wins, however, and the Giants (27-26) boarded their charter flight back home Sunday afternoon with a pair of series victories and a winning record in their back pocket.

The loss Sunday was only their third in their past 13 games, and their 5-2 record in the seven-game swing against the two Central Division leaders amounted to their best mark on a trip this season. With three games left to play this month, the Giants are 16-10 in May, and despite Sunday’s result, appear to have turned a corner.

“I thought it was a really good road trip,” manager Gabe Kapler said. “I was particularly impressed by the way we got down in this game and battled back all the way to the last pitch. It never felt like we were out of the game.”

It’s all in the pitching >> Alex Cobb was tagged for seven runs — all in the first two innings — and snapped a couple streaks in the process.

It was the first time all season that Cobb, the Giants’ most effective starter, had allowed more than three runs in an outing, raising his ERA to 3.05.

It was also the first time in 14 games that the Giants allowed their opponent to score more than four runs, snapping a streak that was the longest in the majors this season and the longest by a San Francisco pitching staff since 2016 (May 6-19). Over the 13-game stretch entering Sunday, Giants pitchers posted a 2.27 ERA while holding opposing batters below the Mendoza line (.197 average).

“I didn’t realize we had a run going like that,” Cobb said. “I knew we were pitching well. I knew we were just playing good baseball. It’s what makes this game tough. We were playing good baseball and had a good run going, had a great road trip going. You just hope (Sunday’s result) doesn’t put too much of a damper on the momentum we’ve created so far.”

The biggest improvements have come in the bullpen, which led the majors in most statistical categories over the past 11 games entering Sunday.

The Giants used bullpen games twice on this trip and won both of them. After Giants relievers ranked as the third-worst group in the majors by ERA in March and April, the 2.61 ERA by Giants relievers this month ranked second best in the majors and was lowered further on Sunday with five scoreless innings from rookies Tristan Beck and Ryan Walker.

“Some really nice pitching from Beck and Walker,” Kapler said. “We needed efficiency, obviously. We needed (Beck) to throw a ton of strikes and keep us in the game and give us a chance to claw our way back into it.”

Stars step up >> When the Giants embarked on this trip, Michael Conforto was batting .210 with a .715 OPS. Mitch Haniger’s average was a point higher, .211, but with no power to pair with it for a .557 OPS. The Giants had gotten little production from their two biggest free agent acquisitions.

But that began to change on this trip.

The only two games the Giants lost on this trip were also the only two games they didn’t get a home run from Haniger or Conforto, who combined to leave the yard five times in seven games while batting .373 (19 for 51). Even in Sunday’s loss, they ripped a pair of consecutive singles to start the seventh inning, setting up Blake Sabol’s three-run homer and kicking off a four-run rally, which simply proved to be too little, too late to complete the series sweep.

Young guns step in >> In the two games the Giants lost on this trip, guess who was missing from the starting lineup — Casey Schmitt and Patrick Bailey.

The Giants won all five games with Bailey catching on this trip and are 6-1 overall when the defensive-minded, switch-hitting catcher is in the lineup. In two games without him behind the plate this trip, they allowed 14 runs, more than twice as many as their total in five games with him (six).

Schmitt began to displace Crawford as the starting shortstop on this trip, starting three consecutive games while a healthy Crawford remained on the bench. But with Crawford back in there Sunday, he proved he still has something in the tank. He ranged to his left, spinning and firing to first for a vintage 6-3 web gem to retire Brian Anderson in the second inning. He also laced a line-drive double to right field and scored one of the Giants’ four runs in the seventh inning.

Kapler, however, seems to understand that Schmitt is the player who gives them the best chance to win ballgames now. It’s a difficult task for a manager to phase out a franchise icon, but it’s been made easier by the notion that Crawford has taken Schmitt under his wing.

“He’s a veteran player that’s had a lot of success for us over the years,” Kapler said before Sunday’s game. “He deserves the highest level of respect. As much as I can communicate with him I will. He’s been a great teammate and I expect the same going forward.”

PROBABLES >> As the Giants head home to face the Pittsburgh Pirates, here’s who is scheduled to pitch this week:

Today, 2:05 p.m. — RHP Anthony DeSclafani (3-4, 3.43) vs. LHP Rich Hill (4-4, 4.27)

Tuesday, 6:45 p.m. — TBA vs. RHP Johan Oviedo (3-4, 4.70)

Wednesday, 12:45 p.m. — LHP Alex Wood (1-0, 3.51) vs. RHP Mitch Keller (6-1, 3.01)