Repository navigation
refactor(build)!: let the connector choose the values backend - #646
Conversation
c0b105c to
2a9534b
Compare
865e703 to
24e84af
Compare
TimoStoff
left a comment
There was a problem hiding this comment.
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.
|
and re top lvl comment: |
06721f0 to
4a056ff
Compare
25a52fd to
7ca6140
Compare
7ca6140 to
3527f95
Compare
RealLast
left a comment
There was a problem hiding this comment.
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
…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.
3527f95 to
a54a43b
Compare
There was a problem hiding this comment.
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_backendparameter is removed from every layer: CLI,ConnectorBuilder.build,build_one,run_isolated,env_spec,run_pipelineandpublish_pipeline. No references to the removed option or argument are left in cli.py. _check_values_backendstill rejects unknown backends before any files change.env_specnow always adds thetimenet[zarr]extra, at the same version pin as before.timenet/coordinator/plan.pymoves unchanged and imports only fromtimenetand 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.
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-backendconcept 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
--values-backendflag is removed, and so does thevalues_backendargument ofbuild_one(),ConnectorBuilder.build(),env_spec()andrun_isolated().values_backendattribute decides the format. It is the only way to choose the backend.timenet_connectors/builder/plan.pytotimenet/coordinator/plan.py. It imports nothing fromtimenet_connectors, and a test makes sure of that.Breaking changes
timenet-build build --values-backendis gone. Thevalues_backendargument ofbuild_one(),ConnectorBuilder.build(),env_spec()andrun_isolated()is gone too.run_pipeline()andpublish_pipeline()no longer takevalues_backend.BaseConnector.values_backendis typedValuesBackendand defaults toValuesBackend.PARQUET.timenet_connectors.builder.planis gone, withplan_parents(),prepare_parents()andParentStep.Stack
Changes later in the stack:
Merge message