Context
PR #217 removed the generated ApiClient, Configuration, and WriteService classes and introduced the internal RestClient.
The write implementation still contains generated OpenAPI request plumbing in influxdb_client_3/write_client/client/write_api.py. This makes the write path harder to maintain and leaves v2-specific generated behavior in a v3 client.
Scope
Simplify the internal WriteApi request path into three focused steps:
serialize(record)
build_write_request(...)
rest_client.request(...)
Remove or consolidate:
_post_write_prepare;
call_api;
_check_operation_params;
_sanitize_for_serialization;
- duplicated request preparation logic;
- stale generated v2 API documentation.
The refactor must preserve the current write behavior:
- v2:
/api/v2/write, bucket, short precision values;
- v3:
/api/v3/write_lp, db, long precision values;
no_sync and accept_partial only for the v3 endpoint;
- gzip, timeout, retry, proxy, TLS, and error translation behavior.
Add or update tests for the v2/v3 request matrix and the existing error cases.
Acceptance criteria
- All existing unit and integration tests pass.
- Request construction is covered for both v2 and v3 endpoints.
- No references to the removed
ApiClient, Configuration, or WriteService remain in the write implementation.
- The write path no longer depends on generic generated OpenAPI request helpers.
- Endpoint selection remains centralized.
- No second HTTP transport abstraction is introduced.
- No public API changes are introduced.
Out of scope
- Adding new InfluxDB endpoints.
WritePrecision.AUTO.
- Redesigning batching or RxPY.
- Moving or renaming
RestClient.
- Changes to the query transport.
- Removing or deprecating publicly reachable methods such as
post_write_async; that requires a separate decision.
Context
PR #217 removed the generated
ApiClient,Configuration, andWriteServiceclasses and introduced the internalRestClient.The write implementation still contains generated OpenAPI request plumbing in
influxdb_client_3/write_client/client/write_api.py. This makes the write path harder to maintain and leaves v2-specific generated behavior in a v3 client.Scope
Simplify the internal
WriteApirequest path into three focused steps:Remove or consolidate:
_post_write_prepare;call_api;_check_operation_params;_sanitize_for_serialization;The refactor must preserve the current write behavior:
/api/v2/write,bucket, short precision values;/api/v3/write_lp,db, long precision values;no_syncandaccept_partialonly for the v3 endpoint;Add or update tests for the v2/v3 request matrix and the existing error cases.
Acceptance criteria
ApiClient,Configuration, orWriteServiceremain in the write implementation.Out of scope
WritePrecision.AUTO.RestClient.post_write_async; that requires a separate decision.