Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions cleancloud/providers/aws/rules/rds_idle.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from datetime import datetime, timedelta, timezone
from typing import List
from typing import List, Optional

import boto3
from botocore.exceptions import ClientError
Expand Down Expand Up @@ -236,7 +236,7 @@ def _estimate_monthly_cost(instance_class: str, multi_az: bool) -> str:
return "Cost varies by instance class (region dependent)"


def _estimate_monthly_cost_usd(instance_class: str, multi_az: bool) -> float | None:
def _estimate_monthly_cost_usd(instance_class: str, multi_az: bool) -> Optional[float]:
"""Numeric monthly cost estimate for aggregation."""
cost_map = {
"db.t3.micro": 12,
Expand Down
4 changes: 3 additions & 1 deletion cleancloud/providers/aws/session.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from typing import Optional

import boto3
from boto3.session import Session


def create_aws_session(profile: str | None, region: str) -> Session:
def create_aws_session(profile: Optional[str], region: str) -> Session:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fix for cloudshell error : TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

Copy link
Collaborator

Choose a reason for hiding this comment

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

so we are not seeing this error during local testing ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no, only in aws cloudshell

if profile:
return boto3.Session(profile_name=profile, region_name=region)

Expand Down
2 changes: 1 addition & 1 deletion cleancloud/providers/azure/rules/sql_database_idle.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def _estimate_monthly_cost(sku_name: str) -> str:
return "Cost varies by SKU (region dependent)"


def _estimate_monthly_cost_usd(sku_name: str) -> float | None:
def _estimate_monthly_cost_usd(sku_name: str) -> Optional[float]:
"""Numeric monthly cost estimate for aggregation."""
if not sku_name:
return None
Expand Down
Loading