Refactor: use dict comprehension in _get_endpoint_prefix_to_name_mappings
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 90/100
Research direction
Open awscli/customizations/configure/addmodel.py and inspect _get_endpoint_prefix_to_name_mappings around lines 21-28. Compare the current manual loop with the proposed comprehension and verify that the endpoint-prefix-to-service-name mapping remains unchanged. Done means the function uses the requested comprehension without changing behavior.
Written by the indexing model from the issue text.
Description
Summary
`_get_endpoint_prefix_to_name_mappings` in `awscli/customizations/configure/addmodel.py` (lines ~21-28) builds a dict manually with an empty-dict-then-loop-assignment pattern, where the loop body does nothing but a single key/value assignment.
Proposed change
Replace with a dict comprehension:
```python
return {
session.get_service_model(service_name).endpoint_prefix: service_name
for service_name in session.get_available_services()
}
```
Pure refactor, no behavior change.
- Dominant language
- Python
- Stars
- 17.3k
- Forks
- 4.7k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 21
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aws/aws-cli
-
bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
codeartifact login investigating p2
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
needs-triage
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100