Skip to content

refactor(build)!: let the connector choose the values backend - #646

Merged
karhu merged 4 commits into
mainfrom
tnet-157/1-groundwork
Nov 10, 2026
Merged

karhu merged 4 commits into
mainfrom
tnet-157/1-groundwork

Conversation

@karhu

@karhu karhu commented Nov 3, 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

Removes the values-backend concept from user facing APIs. The flag allows explicitly picking a format for payload storage (Zarr vs Parquet) when building a dataset. However this is something that should only be decided at the Connector level, ensuring that a built dataset always has the same format. Without it releases of the same dataset and version can have different content & layout, breaking the inheritance assumptions of referencing datasets.

The PR also sets minor ground work for the rest of the stack.

Details

  • The --values-backend flag is removed, and so does the values_backend argument of build_one(), ConnectorBuilder.build(), env_spec() and run_isolated().
  • The connector's values_backend attribute decides the format. It is the only way to choose the backend.
  • The parent planner moves from timenet_connectors/builder/plan.py to timenet/coordinator/plan.py. It imports nothing from timenet_connectors, and a test makes sure of that.

Breaking changes

  • timenet-build build --values-backend is gone. The values_backend argument of build_one(), ConnectorBuilder.build(), env_spec() and run_isolated() is gone too.
  • run_pipeline() and publish_pipeline() no longer take values_backend. BaseConnector.values_backend is typed ValuesBackend and defaults to ValuesBackend.PARQUET.
  • The module timenet_connectors.builder.plan is gone, with plan_parents(), prepare_parents() and ParentStep.

Stack

Changes later in the stack:

Merge message

refactor(build)!: let the connector choose the values backend

The connector alone chooses the storage backend of its values, because
a format override would change the files of a release and break the
child releases that pin them.

- Every isolated build includes the Zarr extra, because the connector
  cannot be imported before its dependencies are installed.
- Parent planning moves into timenet and no longer depends on
  timenet_connectors.

BREAKING CHANGE: timenet-build build loses --values-backend, and
build_one(), ConnectorBuilder.build(), env_spec(), run_isolated(),
run_pipeline() and publish_pipeline() lose values_backend.

BREAKING CHANGE: BaseConnector.values_backend and the values_backend
argument of store_dataset() use the ValuesBackend type and default to
ValuesBackend.PARQUET.

BREAKING CHANGE: plan_parents(), prepare_parents() and ParentStep move
from timenet_connectors.builder.plan to timenet.coordinator.plan.

@karhu karhu changed the title tnet 157/1 groundwork refactor!: lay the groundwork for one build coordinator Nov 3, 2026
@karhu
karhu force-pushed the tnet-157/1-groundwork branch from c0b105c to 2a9534b Compare November 3, 2026 21:22
@karhu
karhu added this pull request to stack #650 November 3, 2026 21:22
@karhu karhu changed the title refactor!: lay the groundwork for one build coordinator refactor(build)!: remove the values backend override and move the planner to timenet Nov 3, 2026

@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.

Thanks this LGTM! SOme minor comments. One thing I did notice is that with the override gone, values_backend: str = "parquet"is now the source of turth for the backend, so a typo like "zar" is only caught at build time. Maybe a good opportunity now to make this a named type. ValuesBackend is a StrEnum already, so typing this as ValuesBackend = ValuesBackend.PARQUET so you could maybe recycle that one.

Comment thread docs/build.md Resolved
@karhu

karhu commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

and re top lvl comment:
Yes done: BaseConnector.values_backend is now a ValuesBackend with the default ValuesBackend.PARQUET.

@karhu
karhu force-pushed the tnet-157/1-groundwork branch 2 times, most recently from 06721f0 to 4a056ff Compare November 5, 2026 14:05
@karhu
karhu force-pushed the tnet-157/1-groundwork branch 2 times, most recently from 25a52fd to 7ca6140 Compare November 6, 2026 07:54
@karhu
karhu removed this pull request from stack #650 November 6, 2026 08:09
@karhu
karhu added this pull request to stack #699 November 6, 2026 08:10
@karhu
karhu force-pushed the tnet-157/1-groundwork branch from 7ca6140 to 3527f95 Compare November 6, 2026 13:54

@RealLast RealLast 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.

LMGTM; I would really like for us to take this opportunity to move some of the functions which are "outside" into classes that own their functionality. I see many functions like_build → why not make them part of the/a class that get's built

@karhu karhu changed the title refactor(build)!: remove the values backend override and move the planner to timenet refactor(build)!: let the connector choose the values backend Nov 9, 2026
…nner to timenet

The build command, build_one(), ConnectorBuilder.build(), env_spec() and run_isolated() no longer
take a values backend. The connector decides the format through its values_backend attribute. A
different format changes the files of a release with the same version, and a child release that
pins the files of its parent then breaks. The isolated environment always includes the Zarr extra,
because the parent process cannot read the connector's choice before the environment exists. The
engine keeps its own parameter for tests and benchmarks.

The parent planner moves from timenet_connectors to timenet.coordinator, because it needs nothing
from timenet_connectors. A test makes sure that it imports nothing from there.

Part of TNET-157.
… gone

Three tests and one assert only showed that the values backend option, argument and parameter no longer exist. They test history, not behavior. A test should not prove that removed code is gone, so this removes them.

Part of TNET-157.
The build reads the values backend only from the connector attribute,
also in the Python API. BaseConnector.values_backend is a ValuesBackend,
and the build still rejects an unknown value.

BREAKING CHANGE: run_pipeline() and publish_pipeline() no longer take values_backend; BaseConnector.values_backend is a ValuesBackend.

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

Part of TNET-157.
@karhu
karhu force-pushed the tnet-157/1-groundwork branch from 3527f95 to a54a43b 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.

I reviewed this PR and didn't find any bugs. It is a breaking change to the public build API and CLI, so a human look would still be worthwhile. One small thing to check: the generated api-nav block in zensical.toml now has a timenet.storage entry, but no timenet.storage module exists in the package. The nav may be out of sync with scripts/gen_api_docs.py.

What was reviewed:

  • The values_backend parameter is removed from every layer: CLI, ConnectorBuilder.build, build_one, run_isolated, env_spec, run_pipeline and publish_pipeline. No references to the removed option or argument are left in cli.py.
  • _check_values_backend still rejects unknown backends before any files change. env_spec now always adds the timenet[zarr] extra, at the same version pin as before.
  • timenet/coordinator/plan.py moves unchanged and imports only from timenet and the standard library, as the new import test expects.

I ran nothing (no tests and no docs generator), so I didn't confirm the nav entry against a fresh generator run.

Extended reasoning...

The change touches the builder CLI, the isolated-env builder, the engine pipelines, the BaseConnector type and the docs nav, across 15 files. It is mostly code removal plus a planner module that moves unchanged. It touches no auth, crypto or data-exposure code. I deferred because it removes several public arguments and a CLI flag, and moves a module, all of which break callers. The zensical.toml nav also lists a timenet.storage page with no matching module. Two human approvals exist, but they came before the latest pushed commits.

@karhu
karhu merged commit f1ce40a into main Nov 10, 2026
5 checks passed
@karhu
karhu deleted the tnet-157/1-groundwork branch November 10, 2026 15:50
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.

3 participants