CodeInterpreter should not require a region argument

Open Beginner friendly
#511 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python
Domain
backend

Research direction

Start at the CodeInterpreter constructor and inspect how its region and boto3 session are used. Verify the default-region path described in the issue, then confirm that creating CodeInterpreter without a region works and that boto3 still reports a missing-region error only when an API operation requires it.

Written by the indexing model from the issue text.

Description

Is your feature request related to a problem? Please describe.
To create a CodeInterpreter, a region string argument must be passed. I use boto3 elsewhere in my application, and rely on its default region resolution mechanics. Now I need to explicit configure a region, which has to come top-down from my application.

Describe the solution you'd like
I should be able to create a CodeInterpreter without passing a region. It should default to using boto3's resolution for the region. If no region is configured, boto3 will raise an exception when performing an API operation.

Describe alternatives you've considered
I can manually create a session and get the region from it, then pass that same session to CodeInterpreter. This isn't quite right though, since region_name may be None. I could check if it's None and raise an exception myself, but having to do all this is awkward. Though I can also see the argument for "explicit is better than implicit."

session = boto3.Session()
code_interpreter = CodeInterpreter(session.region_name, session)
Dominant language
Python
Stars
764
Forks
149
Avg merge
1d 19h
Merged PRs (30d)
7

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aws/bedrock-agentcore-sdk-python

All issues in aws/bedrock-agentcore-sdk-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.