Skip to content

Commit ff71c83

Browse files
fix(examples): remove unnecessary None checks in quota examples (#97)
AccountOverview.id is typed as int (non-optional), making the None checks unreachable code. Removing them fixes Pyright reportUnnecessaryComparison errors.
1 parent 6281066 commit ff71c83

File tree

2 files changed

+0
-4
lines changed

2 files changed

+0
-4
lines changed

examples/cloud/quotas.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ def main() -> None:
2323

2424
# Get client ID from IAM account overview
2525
gcore_client_id = gcore.iam.get_account_overview().id
26-
if gcore_client_id is None:
27-
raise ValueError("Client ID is None for this account")
2826

2927
get_all_quotas(client=gcore)
3028
get_regional_quotas(client=gcore, client_id=gcore_client_id)

examples/cloud/quotas_async.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ async def main() -> None:
2525
# Get client ID from IAM account overview
2626
account_overview = await gcore.iam.get_account_overview()
2727
gcore_client_id = account_overview.id
28-
if gcore_client_id is None:
29-
raise ValueError("Client ID is None for this account")
3028

3129
await get_all_quotas(client=gcore)
3230
await get_regional_quotas(client=gcore, client_id=gcore_client_id)

0 commit comments

Comments
 (0)