valkey-io / valkey-glide

An open source Valkey client library that supports Valkey and Redis open source 6.2, 7.0 and 7.2. Valkey GLIDE is designed for reliability, optimized performance, and high-availability, for Valkey and Redis OSS based applications. GLIDE is a multi language client library, written in Rust with programming language bindings, such as Java and Python
Apache License 2.0
268 stars 56 forks source link

Python - Redefining built-in 'TimeoutError', 'ConnectionError' #2663

Open avifenesh opened 2 weeks ago

avifenesh commented 2 weeks ago

Describe the bug

In python, we use 'TimeoutError', and 'ConnectionError' which are built in error messages, we should avoid breaking the language built in functionality and build on top, we don't want to enforce our implementation and naming on the user app.

Expected Behavior

Library-specific error types, e.g., 'CommandTimeoutError', 'ClientConnectionError' etc.

Current Behavior

'TimeoutError', 'ConnectionError'

Reproduction Steps

--

Possible Solution

Renaming after making sure there's no user which use the specific current messages in theirs app and will get broken. Potentially release a patch in which the errors will be marked as about to be deprecated, and then deprecate them in the release after. Depending on calculating impact.

Additional Information/Context

No response

Client version used

1.1

Engine type and version

--

OS

--

Language

Python

Language Version

--

Cluster information

No response

Logs

Redefining built-in 'ConnectionError'PylintW0622:redefined-builtin

Other information

No response

Yury-Fridlyand commented 2 weeks ago

This comes from protobuf actually. Should we rename this in other clients too. Keep in mind that this fix is a breaking change for any client (even it is a very small change).

avifenesh commented 2 weeks ago

Yea, mentioned that it is a breaking change, it's problematic, I agree. But 1. the sooner, the better. 2. users should have the ability to use the built-in error handling of the language, aside to the error handling of the library.