Open melwil opened 10 months ago
Attention: 9 lines
in your changes are missing coverage. Please review.
Comparison is base (
8b31f93
) 77.08% compared to head (708a6cc
) 76.83%.
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@melwil Agree on the changes you've introduced, that will make it work well for type checkers. However, it will be a breaching change, as in case somebody's already used the client with is_async
parameter, this new version will break for them. But there is no problem with that, we can release v2.0.0
an mention this change in the release notes.
Could you resolve the conflict, please?
This PR aims to improve the constructor for new clients.
I've removed all code related to AsyncClient from client.py, and allowed you to directly make AsyncClient. This does mean it's a breaking change, but one that is easily caught by tests or type checkers.
There are a couple of reasons for this:
new_client()
making both types means that a typed project doesn't know if it has a Client or AsyncClient, and it has to be validated before use.Finally, I will concede that it's not the greatest idea to repeat the code for getting the env vars and validating them in both constructors, it could be moved to some sort of utility function. I can do that if desireable, but in this case it's not a great chance for reusability.