Type annotation of methods which are returning {api_endpoint}.call_with_http_info for asynchronous api is incorrect
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start in src/datadog_api_client/v2/api/spans_metrics_api.py around lines 134-150 and inspect how the asynchronous API client calls call_with_http_info. Check the affected method annotations against the coroutine behavior, then verify that type checkers accept the corrected return types; done means asynchronous methods accurately describe their possible return values.
Written by the indexing model from the issue text.
Description
Describe the bug
For example in [1]:
def create_spans_metric(
self,
body: SpansMetricCreateRequest,
) -> SpansMetricResponse:
"""Create a span-based metric.
Create a metric based on your ingested spans in your organization.
Returns the span-based metric object from the request body when the request is successful.
:param body: The definition of the new span-based metric.
:type body: SpansMetricCreateRequest
:rtype: SpansMetricResponse
"""
kwargs: Dict[str, Any] = {}
kwargs["body"] = body
return self._create_spans_metric_endpoint.call_with_http_info(**kwargs)
when the api client is async, the function returns coroutine. So the return type should be updated to
- ) -> SpansMetricCreateRequest:
+ ) -> SpansMetricCreateRequest | Awaitable[SpansMetricCreateRequest]:
Type checkers are not happy about the current state
- Dominant language
- Python
- Stars
- 166
- Forks
- 55
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 73
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 DataDog/datadog-api-client-python
-
stale
Difficulty 1/5 1-3 hours Newbie friendliness 72/100
DataDog/datadog-api-client-python#3535 · 1 comment ·
-
kind/bug stale
Difficulty 3/5 1-2 days Newbie friendliness 66/100
DataDog/datadog-api-client-python#3717 · 3 comments ·
-
kind/bug stale
Difficulty 3/5 1-2 days Newbie friendliness 75/100
DataDog/datadog-api-client-python#3656 · 1 comment ·
-
kind/bug stale
Difficulty 3/5 1-2 days Newbie friendliness 38/100
DataDog/datadog-api-client-python#3120 · 1 comment ·
-
stale
Difficulty 3/5 1-2 days Newbie friendliness 45/100
DataDog/datadog-api-client-python#2986 · 1 comment ·
All issues in DataDog/datadog-api-client-python
Similar issues
-
essnmx good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
[Feature] 奇物选择添加优先级 Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
syfoud/Simulated_Scepter#174 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Giskard-AI/giskard-oss#2840 · 1 comment ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Openarea: repo bug perceived difficulty: 2
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
yeti-platform/yeti#1380 ·