{/* Auto-generated by scripts/mdx_snippets_gen.py. Do not edit manually. */} export const PyAttachBuildStableIdCache = "table = db.open_table(table_name, namespace_path=namespace_path, branch=branch)\ntable.checkout_latest()\ncached_rows = (\n table.search()\n .where(\"sample_id IN (101, 103)\")\n .select([\"sample_id\"])\n .with_row_id(True)\n .limit(2)\n .to_list()\n)\nids_by_key = {row[\"sample_id\"]: row[\"_rowid\"] for row in cached_rows}\n"; export const PyAttachReadCachedSnapshot = "snapshot = db.open_table(table_name, namespace_path=namespace_path, branch=branch)\nsnapshot.checkout(tag)\nif snapshot.version != cached_version:\n raise RuntimeError(f\"Tag {tag} no longer points to version {cached_version}\")\n\nrows = snapshot.search().where(f\"_rowaddr = {cached_address}\").limit(1).to_list()\n"; export const PyAttachReadStableIdCache = "table.checkout_latest()\nrow_ids = [ids_by_key[101], ids_by_key[103]]\nrows = table.take_row_ids(row_ids, with_row_id=True).to_list()\nrows_by_id = {row[\"_rowid\"]: row for row in rows}\nbatch = [rows_by_id.get(row_id) for row_id in row_ids]\n"; export const PyAttachReadZeroInterval = "from datetime import timedelta\n\nfresh_db = lancedb.connect(\n database_uri,\n read_consistency_interval=timedelta(0),\n **connection_options,\n)\nfresh_reader = fresh_db.open_table(\n table_name, namespace_path=namespace_path, branch=branch\n)\nlatest_count = fresh_reader.count_rows()\n"; export const PyAttachRefreshReader = "reader.checkout_latest()\nrefreshed_count = reader.count_rows()\n"; export const PyAttachTagCachedVersion = "tag = \"training-run-42\"\ntable = db.open_table(table_name, namespace_path=namespace_path, branch=branch)\ntable.tags.create(tag, cached_version)\n";