influxdata / influxdata/iot-api-python

The argument `authorization` in `create_authorization` needs to use a keyword

Open
#12 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
28
Forks
10
PR merge metrics
No merged PRs in 30d

Description

In `api/devices.py#162` the statement...

```
request = authorization_api.create_authorization(authorization)
```

should be

```
request = authorization_api.create_authorization(authorization=authorization)
```

This is related to.

* https://github.com/influxdata/influxdb-client-python/pull/682
* https://github.com/influxdata/influxdb-client-python/pull/680
* https://github.com/influxdata/docs-v2/pull/5701

Note that on clicking the _Auth_ link in the flask UI, the tutorial application is now returning...

```
ApiException
influxdb_client.rest.ApiException: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json; charset=utf-8', 'X-Influxdb-Build': 'OSS', 'X-Influxdb-Version': 'v2.7.11', 'X-Platform-Error-Code': 'invalid', 'Date': 'Wed, 04 Dec 2024 13:04:14 GMT', 'Content-Length': '163'})
HTTP response body: {
"code": "invalid",
"message": "invalid json structure: json: cannot unmarshal object into Go struct field postAuthorizationRequest.orgID of type platform.ID"
}
```

The example here is causing confusion for some users.

I tried to push a branch with this change to create a PR, however I do not have write permissions to this repository.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at api/devices.py#162 and inspect the create_authorization call in the Flask tutorial flow. Update the argument usage to match the issue's requested keyword form, then exercise the Auth link and confirm it no longer returns the reported 400 ApiException.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.