-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-2442: Refactor: use _asdict() in _options_dict() #2670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PYTHON-2442: Refactor: use _asdict() in _options_dict() #2670
Conversation
Replaced manual dictionary creation with the more idiomatic _asdict() method in both CodecOptions and JSONOptions.
|
Hi @RinCodeForge927, thank you for the fix! Looking at the original commit, I think we can remove the private method |
As suggested in PR review, _options_dict is redundant. Replaced its usage in JSONOptions.with_options with _asdict().
|
Thanks for the suggestion! I've removed |
|
Looks like at least one more usage needs to be updated based on the docs build failure: |
Following reviewer feedback, the private method _options_dict has been removed from both CodecOptions and JSONOptions. Call sites have been updated to use _asdict() directly.
|
I've cleaned up the remaining references to |
blink1073
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
|
Thank you for the review! I'm very happy to contribute a small improvement to such a great project. Glad I could help! |
This PR implements the TODOs mentioned in PYTHON-2442 by replacing manual dictionary construction in
_options_dict()with calls to_asdict()in bothCodecOptionsandJSONOptions. This is more idiomatic as these classes inherit from NamedTuple (or use its interface).