Skip to content

Fix/python sdk consistency - #160

Merged
olavgg merged 7 commits into
mainfrom
fix/python-sdk-consistency
Sep 25, 2026
Merged

olavgg merged 7 commits into
mainfrom
fix/python-sdk-consistency

Conversation

@JosteinGj

Copy link
Copy Markdown
Contributor

No description provided.

JosteinGj and others added 7 commits September 25, 2026 12:41
DatasetFilterForm, EventFilterForm and SubscriptionFilterForm all sent
limit=100 when the caller left it unset, and the Python events.filter
did the same through unwrap_or(100). timeseries.filter and every list()
use the server's 1000, so the page size depended on which entity was
asked about. All three now default to 1000.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: jgjesdal <jostein@intellistream.ai>
GET /files/search reads a limit parameter (default 100, clamped to
1000), but FileService::search never sent one, so a search could not
return more than 100 hits. It now takes `limit: Option<u64>`, omitted
when None; Python's files.search gains `limit=None` on both clients.

BREAKING CHANGE: FileService::search (and the blocking mirror) takes a
second argument; pass None for the previous behaviour.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: jgjesdal <jostein@intellistream.ai>
The sync and async insert_from_lists zipped timestamps with values, so
extra entries on the longer side were dropped without a word. Both now
build their collection through lists_to_collection, as the binary twin
already did, which raises ValueError naming the two lengths.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: jgjesdal <jostein@intellistream.ai>
subscriptions.filter raised ValueError when handed both a form and
keywords, where every other filter raises TypeError; it now raises
TypeError too.

The listener raised a bare Exception for every WebSocket failure, so
`except DataHubException` never caught one. listen() and every listener
method now raise DataHubException, with status_code and the problem
attributes set to None since there is no HTTP response behind them.
Using a listener after close() raises ValueError, as a closed Python
file does.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: jgjesdal <jostein@intellistream.ai>
FileUpload::new panicked when the path was missing, a directory or had
no file name, and get_body panicked when the file could not be opened.
From Python that surfaced as PanicException, which derives from
BaseException, so `except Exception` did not catch it.

new and new_with_destination_path now return io::Result<FileUpload>,
and get_body io::Result<Body>; upload_file reports an open failure as a
400 ResponseError. In Python the constructors raise FileNotFoundError,
IsADirectoryError or another OSError through PyO3's io::Error mapping.

BREAKING CHANGE: FileUpload::new, FileUpload::new_with_destination_path
and FileUpload::get_body return io::Result.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: jgjesdal <jostein@intellistream.ai>
This reverts commit 6268fe5. files.search is left as it was.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: jgjesdal <jostein@intellistream.ai>
SubscriptionFilter carries id, externalId, name, timeseries, createdTime
and lastUpdatedTime, and SubscriptionFilterForm takes the family shape:
filter, limit: Option<u64>, and a flattened PageRequest for sort and cursor.

In Python, filter() takes the criteria as keywords or filter= plus
sort_by/sort_order/cursor and returns a Page, like datasets.filter.
SubscriptionFilterForm and DataSort are removed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: jgjesdal <jostein@intellistream.ai>
@JosteinGj
JosteinGj requested a review from olavgg September 25, 2026 12:52
@olavgg
olavgg merged commit 637aa79 into main Sep 25, 2026
18 checks passed
@olavgg
olavgg deleted the fix/python-sdk-consistency branch September 25, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants