Conversation
… the Docs The Python client's reference is built by Sphinx from datahub_python_bindings/python/intellistream_datahub_sdk/__init__.pyi, which is now the one place its signatures and prose live. The same file is what IDEs show on hover, so the site and the tooltip cannot disagree. The build reads the stub statically and needs neither cargo nor the compiled module. sphinx-autoapi documents the data types, one page per class, grouped by hand in docs-python/*.rst; a class missing from those groups fails the build. The service classes are not something a caller names, so a small local extension (docs-python/_ext/service_pages.py) skips them and writes one page per client attribute instead: `timeseries.by_ids(...)`, methods grouped by docs-python/structure.toml, the sync and async clients side by side. A method missing from that file, or a name it lists that no service has, fails the build. The stub changes are what the build and stubtest needed: - Type aliases are gone; every annotation spells out what that parameter accepts, taken from the Rust type it binds to. The shared unions claimed more than most methods take -- timeseries.by_ids never accepted a Resource. - `list[...]` inside the services is `builtins.list[...]`: their `list` method shadowed the builtin, so mypy and Pyright read every later annotation in the class as invalid. DataSort's `property` shadowed `@property` the same way. - Constructors are `__new__`, as pyo3 builds them, and the classes that cannot be subclassed are `@final`. - TimeSeries' constructor matches the runtime order; DatapointsCollectionString declares its real constructor instead of five members it does not have; Page declares the sequence methods it implements. - The timeseries service and TimeSeries carry full numpydoc prose: parameters, returns, raises and runnable examples. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: jgjesdal <jostein@intellistream.ai>
…t works - conf.py: drop the autoapi options and the TOC setting that change nothing in the output (checked by diffing the built site with and without each), and read only the stub rather than the stub and __init__.py. - The stub loses two stale comment blocks: one repeated the DatasetUpdate docstring behind two lines that belonged elsewhere, the other still claimed datasets.search is Latin-letters-only and unranked, both lifted server-side. - AGENTS.md says where Python reference prose goes, that types are spelled out, what fails the build, and how to run it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: jgjesdal <jostein@intellistream.ai>
Every client service now has the numpydoc reference timeseries got first: a class docstring, and for each of its 94 methods a summary, the behaviour a caller must know, and Parameters, Returns, Raises, See Also and Examples as they apply. Each statement was taken from the backend's endpoint contract, the bindings and the Rust SDK, and every object an example constructs was built against the compiled module. Where the old prose disagreed with the code, the code won: events.search is an unranked substring match returned newest first, not ranked; a duplicate relationship type is a 409, not a silent 200; datasets.filter, events.filter and subscriptions.filter send a limit of 100 when none is given, not the server's 1000; a refused delete is a 409 (referenced / would-strand), not a 400. Two annotations change with it. files.delete and files.restore took the FileIdentifiable union's definition, which named IdCollection; the binding accepts int | str | INode | FileUpload and raises TypeError for IdCollection. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: jgjesdal <jostein@intellistream.ai>
…rns it Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: jgjesdal <jostein@intellistream.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Builds the Python client's API reference from this repository, for Read the Docs. The type stub
datahub_python_bindings/python/intellistream_datahub_sdk/__init__.pyiis now the single source ofthe reference: signatures and prose alike. IDEs read the same file on hover, so the site and the
tooltip cannot disagree. The build parses the stub statically and needs no cargo and no compiled
module.
How the site is built
timeseries,datasets, …) are written by a small local Sphinx extension,docs-python/_ext/service_pages.py. Service classes are never named by a caller, so methodsread
timeseries.by_ids(...)rather thanTimeSeriesServiceSync.by_ids(...). Each page openswith a sync/async table and groups its methods under Find / Change / … from
docs-python/structure.toml.per class, grouped by hand in
docs-python/*.rst.structure.toml, a name in it thatno service has, and a class in no group all fail
-W.Stub changes
See Also / Examples), plus
TimeSeries. Behaviour is taken from the backend's endpointcontracts, the bindings and the Rust SDK. Every object an example constructs was built against
the compiled module; the examples were not run against a live server.
claimed more than the methods take; for example,
timeseries.by_idsnever accepted aResource, andfiles.deleterejects theIdCollectionit was annotated with.mypy.stubtestneeded:builtins.list[...]inside the services: theirlistmethod shadowed the builtin, so mypyand Pyright treated later annotations in the class as invalid.
__new__, and non-subclassable classes are@final.TimeSeriesconstructor order now matches the runtime.DatapointsCollectionStringconstructor is now declared.Pagedeclares its sequence methods.events.searchis not ranked.AGENTS.mdgains a short section on where Python reference prose goes and what fails the build.Not in this PR
rule to activate SemVer tags, and enable pull-request builds.
mypy.stubtestjob in CI to keep the stub true to the module. It currently reports about60 findings. Fix/python stub matches runtime #151 overlaps with many of them.
///comments are no longer read by the docs build; they still feedhelp().fixed:
datasets.filterandevents.filterdefault tolimit=100, while the others use theserver's 1000.
files.searchnever sends a limit.insert_from_listssilently truncates mismatched lists.units.by_external_ids/by_external_iddiffer between the sync and async clients./assets/updateand/assets/deletedo not check that the target is an asset.datasets.deleteresolves ids across all node types.Docs pages affected
datahub-sdk-docs should link to this reference instead of hosting its own Python API pages. Its
guides are unaffected.
Conflicts: this rewrites much of the stub. The subscriptions filter rework (removing
SubscriptionFilterForm/DataSort) will conflict in__init__.pyi. After it merges,docs-python/filters-and-identifiers.rstand thesubscriptions.filterdocstring need the sameupdate; the
-Wbuild flags the stale group entry.🤖 Generated with Claude Code