Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(write-api): accept 201 response to write #663

Merged
merged 1 commit into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### Bug Fixes
1. [#652](https://github.com/influxdata/influxdb-client-python/pull/652): Refactor to `timezone` specific `datetime` helpers to avoid use deprecated functions
1. [#663](https://github.com/influxdata/influxdb-client-python/pull/663): Accept HTTP 201 response to write request

## 1.44.0 [2024-06-24]

Expand Down
2 changes: 1 addition & 1 deletion influxdb_client/client/write_api_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,4 @@ async def write(self, bucket: str, org: str = None,
precision=write_precision, async_req=False,
_return_http_data_only=False,
content_type="text/plain; charset=utf-8")
return response[1] == 204
return response[1] in (201, 204)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it's worth doing the same thing as the Golang client and treating any 2xx as a success? Either is good though 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using 2xx as a success indicator is a good approach. I've added this to our backlog, so we will improve both v2 and v3 clients to work this way - https://github.com/orgs/influxdata/projects/108/views/1?pane=issue&itemId=73988042