Modified the function to handle invalid boolean casting by returning …
…None instead of raising a ValueError. This improves robustness and avoids unexpected interruptions in the flow of the program

- [x] closes 58159(Replace xxxx with the GitHub issue number)
- [x] Bug Fix (Modified the function to handle invalid)

Thanks for the contribution! This doesn't address the problem, the returned value should be a boolean but you are returning `None` instead, and in the case where the value isn't a boolean then we want to raise a `ValueError`. > Thanks for the contribution! This doesn't address the problem, the returned value should be a boolean but you are returning `None` instead, and in the case where the value isn't a boolean then we want to raise a `ValueError`.

> HI @Aloqeely Thank you for your valuable feedback. I will make the necessary changes to address the issues you mentioned. Before I submit an updated pull request, I want to ensure that the code passes all relevant test cases locally.

Could you please provide some guidance on how to run the test cases locally? Any specific commands or instructions you could share would be very helpful.

Thank you again for your assistance. Of course! https://pandas.pydata.org/docs/development/contributing_codebase.html#running-the-test-suite Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.