In the code, we did not specify the Ruff version, so it pick the latest version (i.e. 0.0.288 for now) while running ci/cd pipeline. Unfortunately, this latest version deprecated this method type(value) which is used for checking variable types. This method is widely used in our codebase.
To resolve this issue, we have two options:
Fix Ruff Version:
We can fix the Ruff version in our code to a version(0.0.280) that still supports the type(value) method. This would maintain our existing code logic without changes.
Replace type(value) with isinstance():
We can modify our code to use the isinstance() method for checking variable types.
Please share your thoughts on which approach we should take. @alxmrs
In the code, we did not specify the Ruff version, so it pick the latest version (i.e. 0.0.288 for now) while running ci/cd pipeline. Unfortunately, this latest version deprecated this method
type(value)
which is used for checking variable types. This method is widely used in our codebase.To resolve this issue, we have two options:
type(value)
method. This would maintain our existing code logic without changes.type(value)
withisinstance()
: We can modify our code to use theisinstance()
method for checking variable types.Please share your thoughts on which approach we should take. @alxmrs