catalog rebase

Re-derive an entry over its live sources and catalog it as a new entry.

Run it once xorq catalog check-sources reports a changed source. The recorded expression is rebuilt over the schemas the sources have now; the old entry is never edited or removed. Every alias moves to the new entry unless –only-alias names the ones that should; an –alias already on the old entry moves too, and one on another entry is taken from it. An alias the sync’s pull has moved off the old entry stays where the pull put it. The new entry keeps the old one’s wheels and requirements.

Prints the resulting entry name on stdout, and the detail on stderr. With no drift that name is the entry’s own, and nothing is committed: not even the –alias, which stderr says was not added. An entry none of whose sources can be probed is re-derived anyway; if it comes back with its own hash, stderr says that drift was not ruled out, and if it comes back with a new hash, the rebase is refused, since nothing was refreshed.

Exit codes: 0 no drift, drift not ruled out (no source could be probed), or the rebase succeeded 1 refused, or failed: the name does not resolve, the catalog does not open, the entry is pinned, some but not all of its sources cannot be probed, none could be but the entry re-derived to a new hash, the entry was built on another Python minor, –only-alias names an alias the entry lacks, or a write failed (an alias move is rolled back locally, a failed rollback is logged; a failed push is not) 2 a source was unreachable or unreadable, its database is missing, or its reads disagree on its live schema; the record is unreadable or lacks its wheel or requirements; or the options were invalid; nothing written 4 conflict: an op no longer fits its new inputs, or a source’s table is gone; nothing written

Usage

xorq catalog rebase ENTRY [OPTIONS]

Arguments

  • ENTRY—An entry name or alias.

Options

Option Default Description
-a, --alias none Also register this alias for the new entry.
--only-alias none Move only this alias onto the new entry (repeatable).
--sync / --no-sync --sync Push the catalog to its remotes after the operation.
--cache-dir $XORQ_CACHE_DIR or ~/.cache/xorq Directory for parquet cache files.
--ignore-venv-mismatch off Proceed even if the entries’ wheel requirements or Python minor differ.

Examples

xorq catalog rebase prod-matches
xorq catalog rebase prod-matches --only-alias prod -a matches-v2

See also