refactor(job, scripts, backoff): Implement isinstance(...) Python Function for Type Checking
Use isinstance instead of type for type checking
Why
Use Python's builtin isinstance instead of type for type checking.
How
Changed all type(variable) == str/int to isinstance(variable, str/int).
Additional Notes (Optional)
@roggervalf, the test failures don't appear to be related to this P.R.. Is that an accurate assessment? Is the P.R. that you opened yesterday intended to address the underlying issues with the test failures?
@roggervalf, the test failures don't appear to be related to this P.R.. Is that an accurate assessment? Is the P.R. that you opened yesterday intended to address the underlying issues with the test failures?
hi @RGAlexander216, yes this change is being covered in my pr
hi @RGAlexander216, yes this change is being covered in my pr
@roggervalf, if your P.R. is merged, can the checks be retried for this P.R.?
hey @RGAlexander216 seems like something is wrong in this pr, still failing in our tests. Btw once we release latest change you should be able to try it. Still we are working on fix our releases
@roggervalf
- GitHub Copilot says that the OSV-Scanner failed likely due to dependency vulnerabilities. I didn't modify any libraries in my P.R., so that is a pre-existing issue and I believe could be the root of two of the three tests that failed.
- The test of dragonflydb@latest is failing due to what boils down to a comparison in one of the lua scripts that Python's interpreter will handle silently, but is technically incorrect. It's comparing a variable of type boolean to an integer. Python's interpreter will just treat a boolean as a 1 or 0 in this comparison and this particular script is not a part of my P.R., so that is how it is written in the current release.
- The test of redis@7-alpine is failing due to a 503 service unavailable error when trying to run a function/method named getCacheEntry, which is also causing a timeout issue downstream in the pytest run. This is also not a part of my P.R., so it is a part of the current release.
@roggervalf Following up on this. To reiterate, the code modifications I made are not related to the conflicts.
@RGAlexander216 Could you also add a test that fails without your fixes but passes with them? otherwise we cannot know if this really is fixing an issue or not.
The original P.R.'s primary change was completely rewritten since this P.R. was opened. I unwittingly merged the current codebase yesterday overwriting the primary objective. However, the changes that are left do implement the "right" way to type check objects in Python. Otherwise there really isn't any purpose this P.R. anymore.