Could you add `stacklevel=2` here? That makes the warning marginally more useful.

Same for the second warning.