microsoft / microsoft/kiota-python

Align implementations and signatures of public methods handling primitives.

Open
#408 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:breaking-change type:bug
Dominant language
Python
Stars
31
Forks
39
Avg merge
11h 45m
Merged PRs (30d)
42

Description

The implementations for send_primitive and send_collection_of_primitive_async is inconsistent.

If you take a look at the implementation for send_primitive, you'll see that it expects string literals.

However, the implementation for send_collection_of_primitive_async expects types, so making them consistent would be the breaking change.

At the next major version we should change the implementation of send_primitive to take a type parameter instead rather than string literals. This will enable better type validation and more accurate static analysis of parameter passed into the function

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

Read the implementations of send_primitive and send_collection_of_primitive_async in packages/http/httpx/kiota_http/httpx_request_adapter.py, starting with the linked method definitions. Align send_primitive with the type-parameter approach used by the collection method, and confirm that both public signatures provide consistent type validation and static-analysis behavior.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.