Skip to content
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

🐛 model dump시 json mode 적용 #87

Merged
merged 1 commit into from
Feb 24, 2024
Merged

Conversation

mingi3314
Copy link
Owner

@mingi3314 mingi3314 commented Feb 24, 2024


Generated summary (powered by Graphite)

TL;DR

This pull request modifies the to_toml method in the Account class of the account.py file. The method now uses the model_dump function with the "json" mode.

What changed

The to_toml method in the Account class was previously using the model_dump function without any arguments and then updating the model_dict with the brokerage value. This has been changed to use the model_dump function with the "json" mode directly.

-        model_dict = self.model_dump()
-        model_dict.update({"brokerage": self.brokerage.value})
+        model_dict = self.model_dump(mode="json")

How to test

To test this change, you can create an instance of the Account class and call the to_toml method. Ensure that the output is as expected and that the brokerage value is included in the output.

Why make this change

This change simplifies the to_toml method by removing an unnecessary update to the model_dict. By using the "json" mode in the model_dump function, we can ensure that all necessary values, including brokerage, are included in the output. This makes the code cleaner and more efficient.

Copy link
Owner Author

mingi3314 commented Feb 24, 2024

Merge activity

  • Feb 24, 9:32 AM EST: @mingi3314 started a stack merge that includes this pull request via Graphite.
  • Feb 24, 9:35 AM EST: Graphite rebased this pull request as part of a merge.
  • Feb 24, 9:36 AM EST: @mingi3314 merged this pull request with Graphite.

@mingi3314 mingi3314 force-pushed the 02-24-_refactor_test_structure branch from 15a02eb to 0dd52a6 Compare February 24, 2024 14:33
Base automatically changed from 02-24-_refactor_test_structure to main February 24, 2024 14:34
@mingi3314 mingi3314 force-pushed the 02-24-_model_dump_json_mode_ branch from d64a671 to b116c34 Compare February 24, 2024 14:34
@mingi3314 mingi3314 merged commit 656a201 into main Feb 24, 2024
1 check passed
@mingi3314 mingi3314 deleted the 02-24-_model_dump_json_mode_ branch February 24, 2024 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant