Skip to content
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 python/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Bugfixes
- Fix `assets.archive` raising `AttributeError` by reading the correct response field, `archived_run_ids`.
- Fix streaming ingestion failing to start when an ingestion config's flow schema exceeded the streaming client's 4 MiB decode limit. `sift-stream-bindings` 0.5.0 decodes up to 50 MiB.

## [v0.19.1] - July 27, 2026

Expand Down
8 changes: 4 additions & 4 deletions python/lib/sift_client/_internal/grpc_transport/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
DEFAULT_REQUEST_TIMEOUT_SECONDS = 60.0
"""Default per-call deadline applied to unary RPCs that don't set their own."""

MAX_DECODING_MESSAGE_SIZE = 50 * 1024 * 1024
"""Largest gRPC response the client will decode, in bytes (50 MiB)."""


def get_ssl_credentials(cert_via_openssl: bool) -> grpc.ChannelCredentials:
"""
Expand Down Expand Up @@ -165,10 +168,7 @@ def _compute_channel_options(opts: SiftChannelConfig) -> list[tuple[str, Any]]:
# Primary cannot be overriden:
# https://github.com/grpc/grpc/blob/0498194240f55d7f4b12633ad01339fb690621bf/src/core/ext/filters/http/client/http_client_filter.cc#L97
("grpc.secondary_user_agent", _compute_user_agent()),
(
"grpc.max_receive_message_length",
50 * 1024 * 1024,
), # 50 MB — headroom for 1M-row GetData pages
("grpc.max_receive_message_length", MAX_DECODING_MESSAGE_SIZE),
]

enable_keepalive = opts.get("enable_keepalive", True)
Expand Down
2 changes: 1 addition & 1 deletion python/lib/sift_client/_internal/pyproject_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# ``tomllib`` landed in 3.11; ``tomli`` is the same parser packaged for older
# interpreters and is declared as a conditional install dep on 3.8-3.10.
try:
import tomllib # type: ignore[import-not-found,unused-ignore]
import tomllib # type: ignore[import-not-found,import-untyped,unused-ignore]
except ImportError: # pragma: no cover - exercised on 3.8-3.10 only
import tomli as tomllib # type: ignore[no-redef,import-not-found,unused-ignore]

Expand Down
11 changes: 11 additions & 0 deletions python/lib/sift_client/_tests/_internal/test_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

import pytest

from sift_client._internal.grpc_transport.transport import (
MAX_DECODING_MESSAGE_SIZE,
_compute_channel_options,
)
from sift_client.transport.grpc_transport import GrpcClient, GrpcConfig
from sift_client.transport.rest_transport import DEFAULT_REST_TIMEOUT, RestClient, RestConfig

Expand Down Expand Up @@ -150,3 +154,10 @@ def test_timeout_disabled_when_config_none(self):
captured = self._capture_request_kwargs(client)
client.get("/v1/ping")
assert "timeout" not in captured


class TestMaxDecodingMessageSize:
def test_channel_uses_the_fixed_limit(self):
config = GrpcConfig(url="https://grpc.sift.com", api_key="api")
options = dict(_compute_channel_options(config._to_sift_channel_config()))
assert options["grpc.max_receive_message_length"] == MAX_DECODING_MESSAGE_SIZE
12 changes: 6 additions & 6 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ all = [
'pyarrow>=17.0.0',
'pyulog~=1.2.2',
"rosbags~=0.0 ; python_full_version >= '3.8.2'",
'sift-stream-bindings==0.4.1',
'sift-stream-bindings==0.5.0',
'types-pyOpenSSL<24.0.0',
]
build = [
Expand Down Expand Up @@ -115,7 +115,7 @@ dev-all = [
'pyulog~=1.2.2',
"rosbags~=0.0 ; python_full_version >= '3.8.2'",
'ruff~=0.12.10',
'sift-stream-bindings==0.4.1',
'sift-stream-bindings==0.5.0',
'tomlkit~=0.13.3',
'types-pyOpenSSL<24.0.0',
]
Expand Down Expand Up @@ -173,7 +173,7 @@ docs-build = [
'pyulog~=1.2.2',
"rosbags~=0.0 ; python_full_version >= '3.8.2'",
'ruff~=0.12.10',
'sift-stream-bindings==0.4.1',
'sift-stream-bindings==0.5.0',
'tomlkit~=0.13.3',
'types-pyOpenSSL<24.0.0',
]
Expand All @@ -197,10 +197,10 @@ rosbags = [
"rosbags~=0.0 ; python_full_version >= '3.8.2'",
]
sift-stream = [
'sift-stream-bindings==0.4.1',
'sift-stream-bindings==0.5.0',
]
sift-stream-bindings = [
'sift-stream-bindings==0.4.1',
'sift-stream-bindings==0.5.0',
]
tdms = [
'npTDMS~=1.9',
Expand Down Expand Up @@ -248,7 +248,7 @@ docs = [
openssl = ["pyOpenSSL<24.0.0", "types-pyOpenSSL<24.0.0", "cffi~=1.14"]
tdms = ["npTDMS~=1.9"]
rosbags = ["rosbags~=0.0 ; python_full_version >= '3.8.2'"]
sift-stream = ["sift-stream-bindings==0.4.1"]
sift-stream = ["sift-stream-bindings==0.5.0"]
hdf5 = ["h5py~=3.11", "polars~=1.8"] # polars is only used by sift_py; remove once sift_py is fully deprecated
ulog = ["pyulog~=1.2.2"]
data-review = ["pyarrow>=17.0.0"]
Expand Down
Loading
Loading