<#1139 Add 'flyte delete local-cache' command to c...
# flyte-github
a
#1139 Add 'flyte delete local-cache' command to clear the local cache directory Pull request opened by pingsutw Why The Flyte SDK keeps a local cache directory at
~/.flyte/local-cache
(a SQLite DB used for image lookups, bundle uploads, run history, and task caching). When stale entries cause incorrect behavior, there was no first-class way to clear it short of manually deleting the directory. What Adds a
flyte delete local-cache
CLI command that removes the entire
~/.flyte/local-cache
directory. $ flyte delete local-cache Cleared local cache directory: /Users/me/.flyte/local-cache • New
LocalDB._get_cache_dir()
— resolves the local-cache directory (parent of the cache DB), and
_get_db_path()
now derives from it. • New
LocalDB.purge()
— closes all connections, resets state, and `rmtree`s the local-cache directory. Returns the targeted path; re-initialization recreates the DB cleanly on next use. • New
local-cache
subcommand under the existing
flyte delete
group. Tests •
tests/persistence/test_purge.py
—
LocalDB.purge()
removes the whole dir, is a no-op when missing, and the DB is recreated on re-init. •
tests/cli/test_delete.py
— CLI command invokes
purge
and reports the path. All tests pass; `ruff format`/`ruff check` clean. flyteorg/flyte-sdk