Repository navigation
Fix shopping example state handling and add regressions - #73
Merged
Merged
Conversation
Preserve constructor arguments and inherited customer state, implement cart updates and order logs, and isolate default shipment logs across all three versions. Add regression tests without new dependencies. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7411b498-db61-4f72-8629-4af2b007c3a4
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the shopping-system state-handling changes.
No open issues 🎉
What changed in this PR
Fixes state handling in the shopping-system class-design example, keeping the Markdown and both notebooks aligned while leaving unfinished workflows explicitly out of scope.
Changes:
- Preserve constructor arguments, initialize inherited member state, and return the correct customer cart.
- Implement cart quantity updates and order-log appends, reject updates to absent items, and isolate default shipment logs.
- Add nine regression tests covering all three representations and document incomplete workflows.
| File | Description |
|---|---|
tests/test_shopping_example.py |
Adds regression coverage for state handling across all three representations. |
OOP-design/executed_amazon_system.ipynb |
Applies state fixes and clarifies unfinished workflows without changing saved outputs. |
OOP-design/designing_amazon_online_shopping_system.md |
Fixes the documented class implementations and labels the example’s limits. |
OOP-design/designing_amazon_online_shopping_system.ipynb |
Mirrors the state fixes and scope clarification in the source notebook. |
Review effort: Balanced
The regression loader must execute the published snippets, not a separate implementation. Document that it only loads checked-in examples and suppress the specific Bandit B102 and Pylint exec-used warnings on that statement. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7411b498-db61-4f72-8629-4af2b007c3a4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The shopping example discards constructor arguments, cannot retrieve a customer's cart, leaves member state uninitialized, and shares default shipment logs. Cart quantity updates and order logs silently do nothing.
Changes
Validation
git diff --checkpass. Saved outputs and metadata are unchanged.This remains a class-design sketch, not an implementation of checkout, payments, stock reservation, or shipping.