Skip to content

Refine %catalog context resolution and path handling - #61

Merged
oskaresparza merged 10 commits into
mainfrom
staging
Sep 18, 2026
Merged

oskaresparza merged 10 commits into
mainfrom
staging

Conversation

@oskaresparza

Copy link
Copy Markdown
Collaborator

Summary

Brings main up to date with staging — two merged feature PRs (#57 via #58, #59 via #60):

  • use() now only accepts a whole, absolute path and never resolves it against the existing context; list()'s own path is now optional (lists the current context itself); every other single-path verb's bare path stays absolute when it already starts with catalog (this deployment's one real root source).
  • create_folder/data_copy/data_move/set_wiki/delete_wiki/get_wiki/set_tags/delete_tags/get_tags/delete_table/create_view/delete_view now all accept either an absolute path or one relative to the current context; delete_folder's cascade=True now really deletes tables/views underneath (via SQL DROP, not the untrusted generic catalog-REST delete); set_wiki ignores tags on a table/view; CatalogSession now starts with context at the catalog root instead of None; use(None)/use("") reset to that root instead of clearing to no context.

Test plan

  • pytest — 371 passed
  • ruff check / ruff format --check — clean on touched files

🤖 Generated with Claude Code

oskaresparza and others added 10 commits September 18, 2026 10:01
use() now only accepts a whole, absolute path and never resolves it
against the existing context (previously it accepted dot-optional/`../`
relative paths like every other verb) — pointing context somewhere always
means saying exactly where.

list()'s own path is now optional (defaults to listing the current
context itself), and every other single-path verb's bare path now stays
absolute instead of getting silently appended to an existing context when
it already starts with `catalog`, this deployment's one real root source
— previously the only way to mix an absolute path into an already-`use()`d
session was to clear context first.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Refine %catalog context resolution: strict use(), optional list() path
Refine %catalog context resolution: strict use(), optional list() path
…ext defaults

create_folder/data_copy/data_move/set_wiki/delete_wiki/get_wiki/set_tags/
delete_tags/get_tags/delete_table/create_view/delete_view now all accept
either an absolute path or one relative to the current context, matching
use()'s own resolution rules — previously most of them only took absolute
paths, which broke on Dremio's Arctic-backed source (a 400, not 404, on a
by-path lookup into a not-yet-existing nested item) once a custodian tried
a bare create_folder call.

delete_folder's cascade=True now actually deletes tables/views underneath
too, via the same SQL DROP TABLE/VIEW delete_table/delete_view already use,
instead of the generic catalog-REST delete (which Dremio doesn't seem to
trust with real data). set_wiki ignores its tags parameter when path is a
table/view, since those have native tags instead of the wiki "Meta Data"
convention meant for folders.

CatalogSession now starts with context at the catalog root ("catalog")
instead of None, so a custodian's first relative call already has
something to resolve against. use(None)/use("") reset context back to
that same root rather than clearing it to no context at all (that's what
set_context(None) is still for — the lower-level primitive, not normally
called directly). use() also prints "context set to <path>" itself now,
since it never queues anything for the usual commit-report auto-print to
show.

Updated %catalog help, README, the design doc, and both example notebooks
to match throughout.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Allow relative paths on more verbs, cascade real deletes, refine context defaults
Refine %catalog context resolution and path handling
@oskaresparza
oskaresparza merged commit a94d9ac into main Sep 18, 2026
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.

1 participant