-
Notifications
You must be signed in to change notification settings - Fork 5
Add support for Refunds and refine options handling in PAYG cost calculation #117
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
Conversation
|
✅ Why it is requiredThe Developer Certificate of Origin (DCO) is a lightweight way for contributors to certify that they wrote or otherwise have the right to submit the code they are contributing to the project. Here is the full text of the DCO. Contributors sign-off that they adhere to these requirements by adding a Git even has a |
1 similar comment
|
✅ Why it is requiredThe Developer Certificate of Origin (DCO) is a lightweight way for contributors to certify that they wrote or otherwise have the right to submit the code they are contributing to the project. Here is the full text of the DCO. Contributors sign-off that they adhere to these requirements by adding a Git even has a |
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.
Pull Request Overview
This PR refactors the PAYG cost calculation logic to add support for refunds while refining options handling with new cost metrics.
- Modified dictionary keys in data_source_manager to accept string values for cost options and added a new key for showing retail costs.
- Updated cost_manager to pass options through to cost info functions and added logic to handle refund scenarios.
- Expanded cost configuration to include "Refund" as an accepted value.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/cloudforet/cost_analysis/manager/data_source_manager.py | Updated option keys and types for reservation cost handling |
| src/cloudforet/cost_analysis/manager/cost_manager.py | Refactored function signatures and integrated refund support in cost calculation |
| src/cloudforet/cost_analysis/conf/cost_conf.py | Modified configuration to include "Refund" as a valid charge type |
| "include_credit_cost(bool)": False, | ||
| "include_reservation_cost_at_payg(bool)": False, | ||
| "include_reservation_cost_at_payg(str)": "ActualCost", | ||
| "show_reservation_cost_as_retail(bool): False, |
Copilot
AI
Jun 10, 2025
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.
There appears to be a syntax error in the dictionary key: the key 'show_reservation_cost_as_retail(bool)' is missing a closing quote. It should be corrected to "show_reservation_cost_as_retail(bool)": False.
| "show_reservation_cost_as_retail(bool): False, | |
| "show_reservation_cost_as_retail(bool)": False, |
| # if cost_pay_as_you_go == 0.0: | ||
| # cost_pay_as_you_go = self._convert_str_to_float_format( | ||
| # result.get("costinbillingcurrency", 0.0) | ||
| # ) |
Copilot
AI
Jun 10, 2025
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.
[nitpick] Consider removing or clarifying the commented-out code block to enhance maintainability if it is no longer necessary for future reference.
| # if cost_pay_as_you_go == 0.0: | |
| # cost_pay_as_you_go = self._convert_str_to_float_format( | |
| # result.get("costinbillingcurrency", 0.0) | |
| # ) |
Category
Description
Add support for Refunds and refine options handling in PAYG cost calculation
Known issue