mirror of
https://github.com/lancedb/lancedb.git
synced 2026-12-03 07:45:17 +00:00
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:
co-authored by
Xuanwo
parent
fb853bae75
commit
ec230318f6
@@ -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,
|
||||
)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user