Skip to content

feat(client)!: replace get() with get_manifest() and get_card() - #672

Merged
karhu merged 3 commits into
tnet-157/18-build-publishfrom
tnet-157/19-inspection
Nov 10, 2026
Merged

karhu merged 3 commits into
tnet-157/18-build-publishfrom
tnet-157/19-inspection

Conversation

@karhu

@karhu karhu commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

The Stack

This stack covers refactoring the internal logic of how releases are resolved during read, download & build, in particular also in the context of parent releases / parent datasets. On top of that it refactors the public TimeNet APIs and CLI interfaces around these actions, to streamline the behavior across them.

This PR

TimeNet.get() is replaced by get_manifest() and get_card(). timenet info uses get_manifest().

Details

TimeNet.get() asked one registry of the list: the first registry that is not the store. So its manifest can belong to another release than the release that open() reads. It also knows nothing of a release that only an installed connector provides.

  • get_manifest() returns the manifest of the release that open() reads. It resolves the release through the whole list and reads only the manifest. If a registry lists a release but does not serve its files, it returns the listed manifest, so the access pages stay visible.
  • A build creates the manifest of a release. For a release that only an installed connector provides, get_manifest() raises the new TimeNetNotBuiltError, which names get_card() and timenet.build(). download() raises the same error for such a release.
  • get_card() returns the card of the release, from its manifest or from the installed connector.
  • The two methods take org/name@version like open() and add its hints. They share the hints with open() in one private context manager.
  • For a release that no source provides, the two methods raise the error of raise_not_found() in the read coordinator, as open() and download() do. So a missing release gives the same error in each of them.
  • timenet info shows the card and the build command for a release that only an installed connector provides. The build command repeats the --local-registry and --remote-registry that info got.
  • Size: about 560 changed lines.

Design decisions

  • get_manifest() resolves through the whole list, because a manifest of another release than the one that open() reads is misleading.
  • A release that only a connector provides raises TimeNetNotBuiltError and not a manifest with missing fields, because the manifest does not exist before the build. The error names the two ways out.
  • The shared error function keeps the read plan and the client in step, so a missing release gives one error in both.

Breaking changes

  • TimeNet.get() is gone. get_manifest() returns the manifest of the release that open() reads and raises TimeNetNotBuiltError for a release that only a connector provides. get_card() returns its card.

Stack

Changes later in the stack:

Merge message

feat(client)!: replace get() with get_manifest() and get_card()

get_manifest() returns the manifest of the release that open() reads,
because it resolves through the whole list of sources. get() asked
only one registry, so its manifest could belong to another release.

- For a release that only an installed connector provides,
  get_manifest() and download() raise the new TimeNetNotBuiltError,
  which names get_card() and timenet.build().
- For a release that a registry lists but does not serve,
  get_manifest() returns the listed manifest, so the access pages stay
  visible.
- get_card() returns the card of the release, from its manifest or
  from the connector.
- timenet info shows the card and the build command for a release that
  is not built yet.

BREAKING CHANGE: TimeNet.get() is gone. Use get_manifest() or
get_card().

@karhu
karhu added this pull request to stack #650 November 4, 2026 20:04
This was referenced Nov 4, 2026
@karhu
karhu force-pushed the tnet-157/19-inspection branch from 1b579ac to af5e917 Compare November 5, 2026 07:24
@karhu
karhu force-pushed the tnet-157/19-inspection branch from af5e917 to 5975888 Compare November 5, 2026 07:27
@karhu
karhu force-pushed the tnet-157/19-inspection branch from 5975888 to 88142b8 Compare November 5, 2026 08:16
@karhu
karhu force-pushed the tnet-157/19-inspection branch 2 times, most recently from f18a705 to 4ed8639 Compare November 5, 2026 14:05
@karhu
karhu force-pushed the tnet-157/19-inspection branch from 3a8d5d1 to 10367cf Compare November 7, 2026 20:26
@karhu
karhu force-pushed the tnet-157/19-inspection branch from 10367cf to 12b9cc4 Compare November 7, 2026 22:40

@TimoStoff TimoStoff left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm!

Comment thread packages/timenet/src/timenet/errors.py Resolved
Comment thread packages/timenet/src/timenet/client.py Resolved
Comment thread packages/timenet/src/timenet/client.py Resolved
Comment thread packages/timenet/src/timenet/cli/app.py Resolved
Comment thread packages/timenet/src/timenet/cli/app.py Resolved
Comment thread packages/timenet/src/timenet/client.py Resolved
Comment thread packages/timenet/tests/test_cli.py Resolved
Comment thread packages/timenet/tests/test_client.py Resolved
@karhu
karhu force-pushed the tnet-157/19-inspection branch 3 times, most recently from 3c2bb60 to 1d014dc Compare November 9, 2026 13:56
@karhu karhu changed the title feat(client)!: replace get() with get_manifest(), get_card() and plan_read() feat(client)!: replace get() with get_manifest() and get_card() Nov 9, 2026
@karhu
karhu force-pushed the tnet-157/19-inspection branch from 1d014dc to 88e50dd Compare November 9, 2026 16:18
@karhu
karhu force-pushed the tnet-157/19-inspection branch from 88e50dd to 55453be Compare November 10, 2026 14:39

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code review completed

Nothing new to post: everything this review found is already covered by existing comments on this pull request or didn't merit a separate one.

@karhu
karhu force-pushed the tnet-157/19-inspection branch from 55453be to 017579c Compare November 10, 2026 15:50
Comment thread packages/timenet/src/timenet/client.py Resolved
@karhu
karhu removed this pull request from stack #699 November 10, 2026 15:58
@karhu
karhu force-pushed the tnet-157/19-inspection branch from 017579c to 761dfd1 Compare November 10, 2026 16:24
@karhu
karhu added this pull request to stack #772 November 10, 2026 16:24

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code review completed

Nothing new to post: everything this review found is already covered by existing comments on this pull request or didn't merit a separate one.

Still open from earlier reviews (1):

If you have decided not to act on one of these findings, resolve its thread (a reply alone leaves it open) and the next review stops counting it. To review this commit again now, use Re-run on its "Claude Code Review" check.

TimeNet.get() asked one registry of the list: the first registry that is
not the local registry. So its manifest could belong to another release
than the release that open() reads. It also knew nothing of a release
that only an installed connector provides.

get_manifest() returns the manifest of the release that open() reads.
It resolves the release through the whole list, and it reads only the
manifest. If a registry lists a release but does not serve its files,
the call returns the listed manifest, so the access pages stay visible.
A release gets its manifest when it is built. So for a release that
only an installed connector provides, get_manifest() raises the new
TimeNetNotBuiltError. The error holds the release and the card of the
connector, and it writes its own message. download() raises the same
error for such a release.

get_card() returns the card of the release, from its manifest or from
the installed connector.

The two methods take org/name@version like open(), and they add the
hints of open(). open() and the two methods share these hints in one
private context manager. raise_not_found() in the read coordinator
raises the error for a release that no source provides. The plan of a
read and the client use it, so both raise the same error.

timenet info calls get_manifest(). For a release that only an
installed connector provides, it shows the card from the error and the
build command that adds the schema and the counts. So info resolves
the release once. The command repeats the --local-registry and
--remote-registry that info got.

BREAKING CHANGE: TimeNet.get() is gone. get_manifest() returns the
manifest of the release that open() reads and raises
TimeNetNotBuiltError for a release that only a connector provides.
get_card() returns its card.

Part of TNET-157.
Shorter docstrings for the code that this change adds or changes.

Part of TNET-157.
Drop tests that cannot fail or repeat other tests, and sharpen the rest.

Part of TNET-157.
@karhu
karhu force-pushed the tnet-157/19-inspection branch from 761dfd1 to e1b635b Compare November 10, 2026 17:41
@karhu
karhu merged commit 6efd907 into main Nov 10, 2026
4 of 8 checks passed
@karhu
karhu deleted the tnet-157/19-inspection branch November 10, 2026 18:24
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