That is the topic of a new paper from Daniel M. Thompson, political science at Stanford. The answer is “not very”:
Is local law enforcement conducted differently based on the party in power? I offer an answer to this question by focusing on a case in which law enforcement is elected and has meaningful independent discretion: sheriff compliance with federal requests to detain unauthorized immigrants. Using a regression discontinuity design in a new dataset of over 3,200 partisan sheriff elections and administrative data on sheriff behavior, I find that Democrats and Republicans comply at nearly the same rate. These results contribute to ongoing research into the role that partisanship plays in local policymaking, indicating that law enforcement officers make similar choices across party lines even when they have broad authority. I also present evidence that sheriffs hold more similar immigration enforcement views across party than the general public, highlighting the role of candidate entry in determining the level of partisan polarization.
For the pointer I thank Andrew Hall. And here is Daniel Thompson on Twitter.