Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ def _postgres_parse_list_capability(result, is_offer_restriction_check_required=
geo_backup = [feature for feature in supported_features if feature.name == "GeoBackup"]
autonomous_tuning = [feature for feature in supported_features if feature.name == "IndexTuning"]

# Update once capability calls are corrected for each command
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This TODO comment is vague and lacks an actionable plan. It's unclear what "capability calls are corrected for each command" means or what the expected outcome would be. Consider either:

  1. Making this comment more specific about what needs to be corrected and what the expected behavior should be
  2. Creating a tracking issue and referencing it in the comment
  3. Removing the comment if the current behavior is acceptable

Vague TODO comments tend to accumulate technical debt without providing clear guidance for future maintainers.

Suggested change
# Update once capability calls are corrected for each command

Copilot uses AI. Check for mistakes.
if restricted == "Enabled" and not is_offer_restriction_check_required:
raise InvalidArgumentValueError("The location is restricted for provisioning of flexible servers. Please try using another region.")
raise InvalidArgumentValueError("The location is restricted from performing this operation.")
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message "The location is restricted from performing this operation." is grammatically awkward because a location cannot perform an operation. Consider rephrasing to something more natural like "This operation is restricted in the selected location." or "The selected location does not support this operation." to better convey that it's the operation that's restricted in that location, not the location performing the operation.

Suggested change
raise InvalidArgumentValueError("The location is restricted from performing this operation.")
raise InvalidArgumentValueError("This operation is restricted in the selected location.")

Copilot uses AI. Check for mistakes.

if restricted != "Disabled" and not is_offer_restriction_check_required:
raise InvalidArgumentValueError("No available SKUs in this location.")
Comment on lines 59 to 63
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two conditions have overlapping logic. When restricted == "Enabled", the first condition (line 59) will raise an error with the message "The location is restricted from performing this operation." However, if that error is not raised (e.g., due to is_offer_restriction_check_required being True), the second condition (line 62) will also be true since "Enabled" != "Disabled", causing it to raise a different error with the message "No available SKUs in this location."

This creates inconsistent behavior where the same state (restricted == "Enabled") can result in different error messages depending on the value of is_offer_restriction_check_required. Consider using elif for the second condition to prevent this overlap, or adjust the logic to handle the "Enabled" state more explicitly.

Copilot uses AI. Check for mistakes.
Expand Down
Loading