fix: point the compaction warning at the current docs page (#4913)

Refs #4371

The link checker flags
`https://docs.lancedb.com/performance#compaction-and-cleanup` because
that section no longer exists. Compaction has its own page now, and its
"When to run it" section (`#when`) covers the warning this link is
attached to: tables with many small fragments.

This points `DocLink::Compaction` at `/maintenance/compaction#when` and
updates the two tests that hard-code the URL. The anchor exists on the
published site and in `docs/web/maintenance/compaction.mdx`, so
`test_all_doc_links_resolve_in_repo_docs` still holds.

Tests: `python -m unittest ci.tests.test_extract_sdk_doc_links` and
`cargo test -p lancedb --lib docs::tests::` pass locally.

Co-authored-by: Xuanwo <github@xuanwo.io>
This commit is contained in:
George Khananaev
2026-12-01 22:09:04 +08:00
committed by GitHub
co-authored by Xuanwo
parent fb853bae75
commit ec230318f6
3 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -15,7 +15,7 @@ class TestExtractSdkDocLinks(unittest.TestCase):
def test_extracts_all_links_from_repo_docs_rs(self) -> None:
urls = extract_doc_links()
self.assertIn(
"https://docs.lancedb.com/performance#compaction-and-cleanup",
"https://docs.lancedb.com/maintenance/compaction#when",
urls,
)
self.assertIn(
@@ -38,7 +38,7 @@ class TestExtractSdkDocLinks(unittest.TestCase):
self.assertEqual(rc, 0)
content = out.read_text(encoding="utf-8")
self.assertIn(
"<https://docs.lancedb.com/performance#compaction-and-cleanup>",
"<https://docs.lancedb.com/maintenance/compaction#when>",
content,
)
+1 -1
View File
@@ -13,7 +13,7 @@ def test_python_sdk_utm_content_and_doc_links(tmp_path):
expected_content = f"utm_content=python-{_core_version}"
assert (
compaction_url
== f"https://docs.lancedb.com/performance?utm_source=lancedb_sdk&utm_medium=warning&utm_campaign=compaction&{expected_content}#compaction-and-cleanup"
== f"https://docs.lancedb.com/maintenance/compaction?utm_source=lancedb_sdk&utm_medium=warning&utm_campaign=compaction&{expected_content}#when"
)
db = lancedb.connect(tmp_path)
+2 -2
View File
@@ -157,7 +157,7 @@ impl DocLink {
/// edition.
pub const fn path(self) -> &'static str {
match self {
Self::Compaction => "/performance",
Self::Compaction => "/maintenance/compaction",
Self::Reindexing => "/indexing/reindexing",
Self::Sql => "/search/sql",
Self::BranchDiff | Self::BranchCherryPick => "/tables/branching",
@@ -176,7 +176,7 @@ impl DocLink {
/// Optional `#anchor` fragment on the target documentation page.
pub const fn anchor(self) -> Option<&'static str> {
match self {
Self::Compaction => Some("compaction-and-cleanup"),
Self::Compaction => Some("when"),
Self::Reindexing => Some("incremental-reindexing"),
Self::BranchDiff => Some("diff-a-branch"),
Self::BranchCherryPick => Some("merge-a-branch"),