microsoft / microsoft/kiota-python

[Bug] HttpxRequestAdapter: The silent deprecation of base_url is actually a breaking change

Open
#501 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
31
Forks
39
Avg merge
11h 45m
Merged PRs (30d)
42

Description

#481 actually introduced a breaking change.

The parameter base_url is still there but no matter what value you provide, it's ignored. We did not pass a value for http_client, and only specified the base_url like this:

request_adapter = HttpxRequestAdapter(
    authentication_provider, base_url="https:/example.com"
)

We run this in a Fabric notebook where the version of the package was not pinned. So the moment it downloaded the new version, it failed with a misleading error.

To fix it, we had to do the following work around:

request_adapter = HttpxRequestAdapter(authentication_provider)
request_adapter.base_url = "https:/example.com"

I think it's best to deprecate this base_url parameter in the constructor if it's not supposed to be used.

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.

Research direction

Start with HttpxRequestAdapter and inspect how its constructor handles base_url after change #481; compare the reported workaround with the parameter's current behavior. Clarify whether the intended outcome is deprecating the constructor parameter or restoring its effect, then verify the chosen behavior with regression coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.