Refine %catalog context resolution and path handling - #60
Merged
Merged
Conversation
…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
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brings staging up to date with
development— two merged PRs:use()now only accepts a whole, absolute path and never resolves it against the existing context;list()'s ownpathis now optional (lists the current context itself); every other single-path verb's bare path stays absolute when it already starts withcatalog(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_viewnow all accept either an absolute path or one relative to the current context;delete_folder'scascade=Truenow really deletes tables/views underneath (via SQLDROP, not the untrusted generic catalog-REST delete);set_wikiignorestagson a table/view;CatalogSessionnow starts with context at the catalog root instead ofNone;use(None)/use("")reset to that root instead of clearing to no context.Test plan
pytest— 371 passedruff check/ruff format --check— clean on touched files🤖 Generated with Claude Code