From 9519b2bc4576cee89e29716cac6ce1d92a47f57a Mon Sep 17 00:00:00 2001 From: oesparza Date: Tue, 1 Dec 2026 10:40:19 +0100 Subject: [PATCH] Catalog test notebook: strip outputs Co-Authored-By: Claude Opus 5.5 --- debugger/test_catalog_magic.ipynb | 655 ++++-------------------------- 1 file changed, 79 insertions(+), 576 deletions(-) diff --git a/debugger/test_catalog_magic.ipynb b/debugger/test_catalog_magic.ipynb index 72b0b59..341df06 100644 --- a/debugger/test_catalog_magic.ipynb +++ b/debugger/test_catalog_magic.ipynb @@ -29,27 +29,10 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "3f7af2e9", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Sign in to the EEA Lakehouse: open https://172.28.1.6:31443/auth/realms/eea_datalakehouse/device?user_code=EWYT-YSAG (code EWYT-YSAG)\n", - "signed in as eea-admin\n", - "env file /home/oesparza/datahub/EEALakeHouse.python/debugger/.env\n", - "backend polaris\n", - "POLARIS_URI https://172.28.1.6:31443/api/catalog\n", - "catalog (root) eea_lakehouse\n", - "CA file /home/oesparza/datahub/EEALakeHouse.python/debugger/lakehouse-ca.crt\n", - "signed in as eea-admin\n", - "object store http://172.28.1.6:9000\n", - "DDS https://172.28.1.6:31443/dds\n" - ] - } - ], + "outputs": [], "source": [ "import os\n", "from pathlib import Path\n", @@ -100,7 +83,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "bdfc96fa", "metadata": {}, "outputs": [], @@ -120,38 +103,10 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "id": "b94a800b", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "%catalog methods — usage: %catalog data_copy(\"a.b\", \"c.d\") | %catalog set_tags(\"a.b\", [\"reviewed\"]) (each call runs immediately)\n", - "Backend: Dremio or Polaris, picked by EEA_CATALOG_BACKEND (unset: Polaris when POLARIS_URI is set). On Polaris paths start with the catalog's name (POLARIS_CATALOG, 'eea_lakehouse'), a folder is a namespace, and you are signed in with your Keycloak token (KEYCLOAK_ACCESS_TOKEN; else POLARIS_CLIENT_ID/POLARIS_CLIENT_SECRET).\n", - "A new session's context starts at 'catalog' (the root source), not empty — use(None)/use('') reset back to it too; only set_context(None) clears it to no context at all.\n", - "Every path/source_path/target_path (except use's own) is either absolute or relative to the current context, once one is set:\n", - " - starts with 'catalog.' (this deployment's one real root source; 'eea_lakehouse.' on Polaris) -> always absolute, used exactly as given, never appended to the context\n", - " - '.' or './' alone -> the context itself, exactly as get_context() shows it\n", - " - '../' (or a bare '..'), optionally chained ('../../') -> walks up that many levels of the context first, then appends whatever's left, if anything\n", - " - '.name', or a bare 'name' with no leading '.' at all -> both mean relative to the context; the dot is optional sugar, not what makes it relative\n", - "Only use() ever changes the context — no other call does, even one that fully resolved an absolute path.\n" - ] - }, - { - "data": { - "text/html": [ - "
CommandParametersDescription
usepathSet the current path for every call after this one; path must be a whole, absolute path — never relative to the current context, unlike every other verb's path/source_path/target_path. None or '' resets it to the root ('catalog' on Dremio, 'eea_lakehouse' on Polaris). Raises if path doesn't exist in the catalog. See %%catalog to set it once at the top of a cell.
get_contextShow the current path. A new session starts at the root ('catalog' on Dremio, 'eea_lakehouse' on Polaris); use(None)/use('') reset back to it too — None only after an explicit set_context(None).
data_copysource_path, target_path, overwrite=False, create_target_folder=FalseCopy source_path to target_path. overwrite=False (default) raises CatalogOperationError if target_path already exists; overwrite=True replaces it and is not undoable. A target_path ending in / is a folder, not the table: the folder is created first if it doesn't exist (every missing level), and the table lands inside it under the source's own name — data_copy("draft.t", "archive/2027/") makes archive.2027.t; "./" is the context itself; undo removes the folders it created. create_target_folder=True creates every missing folder level of target_path — except the space/source itself, which must already exist (raises CatalogOperationError otherwise).
data_movesource_path, target_path, overwrite=False, create_target_folder=FalseMove source_path to target_path, always as a TABLE (use create_view for a view). overwrite=False (default) raises CatalogOperationError if target_path already exists; overwrite=True replaces it and is not undoable. A target_path ending in / is a folder, not the table: the folder is created first if it doesn't exist (every missing level), and the table lands inside it under the source's own name — data_copy("draft.t", "archive/2027/") makes archive.2027.t; "./" is the context itself; undo removes the folders it created. create_target_folder=True creates every missing folder level of target_path — except the space/source itself, which must already exist (raises CatalogOperationError otherwise).
create_versionsource_path, version_name, tables=None, target_path=None, overwrite=False, create_target_folder=TrueCopy the listed tables from source_path into a new folder target_path.version_name (as CREATE TABLE snapshots, keeping each table's sub-folders). source_path and version_name must not be blank. tables omitted or empty copies everything under source_path. Each entry is a table or a folder (= every table under it), named as listed under source_path or as list() shows them. target_path omitted means the current context — use() picks where versions go; a missing target_path is created unless create_target_folder=False. Reference/vocabulary tables (a folder named reference(s)/vocabulary(ies) in the path) and views are skipped; the report's notes say which. An existing version folder is an error unless overwrite=True (replaces the listed tables, keeps the rest).
draft_to_versionversion_name, tables=None, overwrite=Falsecreate_version from the dataflow's draft folder, with no paths to type: the source is the draft folder the context is in (or the draft folder inside the context), the target is draft's parent.versions.version_name (versions is created if missing). tables as in create_version: omitted or empty copies everything in draft. Unlike create_version, views in draft are not skipped: each is copied into the version as a table (a snapshot of what it returns); the report's notes say which.
update_latest_releaseversion_name, overwrite=TrueCreate a view at the Area's root for every table in versions.version_name, keeping its sub-folders (versions.v1.a.t gets the view a.t; missing folders are created). The context must be the Area folder — one with draft and versions folders just below it, typically catalog.<domain>.<subdomain>.<area> — and versions.version_name must exist — raises at once otherwise. Views in the version are skipped. An existing view is dropped and recreated over the version (overwrite=True, the default; not undoable) — overwrite=False makes it an error instead; an existing table is always an error. Each view is tagged #public, and #public is removed from every table/view under versions, so only the latest release is public.
publishpath=None, overwrite=True, partition_by=NoneCopy every #public view of a dataflow folder (as update_latest_release leaves them) into public_s3."dh-prod-data-public", as tables at the same full catalog path (catalog.x.y.dataflow.a.t is copied to public_s3."dh-prod-data-public".catalog.x.y.dataflow.a.t). The dataflow folder is path when given (absolute, or relative to the context), else the %catalog use(...) context; with neither it raises. It must have draft, versions and reference (or references) folders just below it — raises at once otherwise. Views and tables in those three folders are ignored; views without the tag are skipped and the report's notes say which. An existing table is replaced (overwrite=True, the default; not undoable) — overwrite=False makes it an error, and then nothing is copied. Each table is checked once copied, and the report's notes give its row count. All or nothing: if any table fails, everything the publish did is rolled back (replaced tables are restored) and an error says which table failed. partition_by (optional) partitions the tables by existing fields, in order: a list for every view (partition_by=["year", "country"]), or a dict for each view's own, keyed by its path below the Area (partition_by={"eu_sdg.monitoringsites": ["year"]}; views left out are not partitioned). A field a view doesn't have raises at once, when publish is called. On Polaris each #public view goes through the Document Service into the public store at <namespace path>/<view>/ (DDS_BASE_URL; you must be a publisher): not all or nothing — an error names the views already published — and partition_by / overwrite=False are not available.
listpath=''Show every table/view under path as a JSON array of {type, name} — type TABLE or VIEW, name the full dot-separated path: its own, then every child folder's, at any depth — walked folder by folder through the catalog's own API (Dremio's or Polaris'), no SQL. path may use '.' or '/' separators. path may be omitted to list the current context itself — raises CatalogSessionError if none is set. Raises CatalogOperationError if path doesn't exist.
schemapathShow path's column schema and row count (never fetches the actual rows). path must be a table or view — raises CatalogOperationError otherwise, or if path doesn't exist at all.
delete_tablepathDelete the table at path. Not undoable. Raises CatalogOperationError if path doesn't exist (unlike a bare DROP TABLE, this doesn't quietly no-op on a typo).
create_viewsource_path, target_path, overwrite=False, create_target_folder=FalseCreate a VIEW at target_path over source_path, leaving source_path untouched. overwrite=False (default) raises CatalogOperationError if target_path already exists; overwrite=True replaces it and is not undoable. create_target_folder=True creates every missing folder level of target_path — except the space/source itself, which must already exist (raises CatalogOperationError otherwise).
delete_viewpathDelete the view at path. Not undoable. Raises CatalogOperationError if path doesn't exist (unlike a bare DROP VIEW, this doesn't quietly no-op on a typo).
set_wikipath, text, tags=NoneSet a path's wiki text. tags: a list of {tag_name, tag_value, tag_title} dicts, e.g. [{"tag_name": "owner", "tag_value": "bw-team", "tag_title": "Owner"}]. Ignored if path is a table/view (they have set_tags/get_tags for that instead).
delete_wikipathDelete a path's wiki text.
get_wikipathShow a path's wiki text. Raises CatalogOperationError if the path doesn't exist, or exists but has no wiki at all.
set_tagspath, tagsReplace a path's tag set. tags: a list of strings, e.g. ["reviewed"]. Tables/views only — raises CatalogOperationError otherwise. On Polaris folders take tags too, and tags are kept lower case without '#' ('#public' and 'public' are the same tag).
delete_tagspath, tagsRemove tags from a path's tag set. tags: a list of strings, e.g. ["reviewed"]. Tables/views only — raises CatalogOperationError otherwise.
get_tagspathShow the tags on a path — tables/views only. Raises CatalogOperationError if the path doesn't exist or isn't a table/view.
create_folderpath, create_parents=FalseCreate a folder. create_parents=True creates every missing level of the full path; create_parents=False (default) raises CatalogOperationError if the parent folder doesn't already exist.
delete_folderpath, cascade=FalseDelete a folder. Not undoable. cascade=True also deletes everything at path and below; cascade=False (default) raises CatalogOperationError if the folder isn't empty. A path that's already gone is not an error.
" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], + "outputs": [], "source": [ "%catalog help" ] @@ -170,19 +125,10 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "id": "c4c97822", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "TEST_FOLDER eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test (exists already!)\n", - "SOURCE_TABLE eea_lakehouse.biodiversity_ecosystems.protected_areas.dfl_natura2000.draft.sites.aaaa exists: True\n" - ] - } - ], + "outputs": [], "source": [ "from eea_datalakehouse.catalog.polaris import PolarisCatalog\n", "\n", @@ -209,39 +155,20 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "id": "45d8ff5e", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "CommitReport(succeeded=[\"create folder 'eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test'\"], notes=[])" - ] - }, - "execution_count": 5, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "%catalog create_folder(TEST_FOLDER, create_parents=True)" ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "id": "d90b81ed", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "folder exists right now: True | is a namespace: True\n" - ] - } - ], + "outputs": [], "source": [ "print(\"folder exists right now:\", verify.exists(TEST_FOLDER), \"| is a namespace:\", verify.is_folder(TEST_FOLDER))" ] @@ -259,28 +186,10 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "id": "3721db27", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "context set to 'eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test'\n" - ] - }, - { - "data": { - "text/plain": [ - "'eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test'" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "%catalog use(TEST_FOLDER)\n", "%catalog get_context()" @@ -288,39 +197,20 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "id": "bedfc770", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "CommitReport(succeeded=[\"create folder 'eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.nested'\"], notes=[])" - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "%catalog create_folder(\"nested\") # -> TEST_FOLDER + \".nested\"" ] }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "id": "3bd26c7e", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "nested folder exists right now: True\n" - ] - } - ], + "outputs": [], "source": [ "print(\"nested folder exists right now:\", verify.exists(f\"{TEST_FOLDER}.nested\"))" ] @@ -339,68 +229,30 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "id": "29ac62a2", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "CommitReport(succeeded=[\"set wiki on 'eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test'\"], notes=[])" - ] - }, - "execution_count": 10, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "%catalog set_wiki(\".\", \"# Catalog magic smoke test\\n\\nCreated by the %catalog debugger notebook.\", tags=[{\"tag_name\": \"owner\", \"tag_value\": \"debugger\", \"tag_title\": \"Owner\"}])" ] }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "id": "f76508c9", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "# Catalog magic smoke test\n", - "\n", - "Created by the %catalog debugger notebook.\n", - "\n", - "# Meta Data\n", - "\tOwner : debugger\n", - "\n", - "\n", - "\n" - ] - } - ], + "outputs": [], "source": [ "print(verify.getwikifrom(TEST_FOLDER, idempotency_key=\"smoke-read-wiki\"))" ] }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "id": "2a3d9a5b", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "['smoke', 'test']" - ] - }, - "execution_count": 12, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "%catalog set_tags(\".\", [\"#Smoke\", \"test\"])\n", "%catalog get_tags(\".\")" @@ -419,18 +271,10 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "id": "5ca5d62e", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "catalog error: commit failed at step 1/1 (delete folder 'eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test'): 'eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test' is not empty — pass cascade=True to delete everything in it. Everything before it was rolled back.\n" - ] - } - ], + "outputs": [], "source": [ "%catalog delete_folder(TEST_FOLDER) # cascade=False (the default) — expected to fail, folder not empty" ] @@ -449,81 +293,40 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "id": "a4e6d60b", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "CommitReport(succeeded=[\"data_copy 'eea_lakehouse.biodiversity_ecosystems.protected_areas.dfl_natura2000.draft.sites.aaaa' -> 'eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.nested.copy'\"], notes=[])" - ] - }, - "execution_count": 13, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "%catalog data_copy(SOURCE_TABLE, \"nested.copy\")" ] }, { "cell_type": "code", - "execution_count": 14, + "execution_count": null, "id": "f3a7c4aa", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "TableInfo(schema={'id': 'long', 'station': 'string', 'measured_at': 'timestamptz', 'value': 'double', 'is_valid': 'boolean', 'reported_on': 'date'}, row_count=10)" - ] - }, - "execution_count": 14, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "%catalog schema(\"nested.copy\")" ] }, { "cell_type": "code", - "execution_count": 15, + "execution_count": null, "id": "faec2ef2", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "copy is a: TABLE\n" - ] - } - ], + "outputs": [], "source": [ "print(\"copy is a:\", verify.entry_kind(f\"{TEST_FOLDER}.nested.copy\", idempotency_key=\"smoke\"))" ] }, { "cell_type": "code", - "execution_count": 16, + "execution_count": null, "id": "d7b20734", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "TableInfo(schema={'id': 'long', 'station': 'string', 'measured_at': 'timestamptz', 'value': 'double', 'is_valid': 'boolean', 'reported_on': 'date'}, row_count=10)" - ] - }, - "execution_count": 16, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "%catalog create_view(\"nested.copy\", \"nested.copy_view\")\n", "%catalog schema(\"nested.copy_view\")" @@ -531,48 +334,20 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": null, "id": "27b35c16", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "SELECT * FROM \"eea_lakehouse\".\"non_domain_datasets.catalog_magic_smoke_test.nested\".\"copy\"\n" - ] - } - ], + "outputs": [], "source": [ "print(verify.view_sql(f\"{TEST_FOLDER}.nested.copy_view\"))" ] }, { "cell_type": "code", - "execution_count": 18, + "execution_count": null, "id": "4509ca89", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[\n", - " {\n", - " \"type\": \"TABLE\",\n", - " \"name\": \"eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.moved.copy\"\n", - " },\n", - " {\n", - " \"type\": \"VIEW\",\n", - " \"name\": \"eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.nested.copy_view\"\n", - " }\n", - "]" - ] - }, - "execution_count": 18, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "%catalog data_copy(SOURCE_TABLE, \"nested.copy\", overwrite=True) # replaces the table\n", "%catalog data_move(\"nested.copy\", \"moved/\") # a target ending in / is a folder, created\n", @@ -593,18 +368,10 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": null, "id": "73a7e215", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "context set to 'eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke'\n" - ] - } - ], + "outputs": [], "source": [ "AREA = f\"{TEST_FOLDER}.dfl_smoke\"\n", "%catalog create_folder(f\"{AREA}.draft\", create_parents=True)\n", @@ -616,115 +383,50 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": null, "id": "fb1e2aec", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "CommitReport(succeeded=[\"create version 'eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.versions.v2026_1' from 'eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.draft' (all tables)\"], notes=[])" - ] - }, - "execution_count": 20, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "%catalog draft_to_version(\"v2026_1\")" ] }, { "cell_type": "code", - "execution_count": 21, + "execution_count": null, "id": "3d8855a5", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "CommitReport(succeeded=[\"create views under 'eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke' for the tables in 'eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.versions.v2026_1'\"], notes=[])" - ] - }, - "execution_count": 21, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "%catalog update_latest_release(\"v2026_1\")" ] }, { "cell_type": "code", - "execution_count": 22, + "execution_count": null, "id": "65299b51", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[\n", - " {\n", - " \"type\": \"TABLE\",\n", - " \"name\": \"eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.draft.stations\"\n", - " },\n", - " {\n", - " \"type\": \"VIEW\",\n", - " \"name\": \"eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.stations\"\n", - " },\n", - " {\n", - " \"type\": \"TABLE\",\n", - " \"name\": \"eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.versions.v2026_1.stations\"\n", - " }\n", - "]" - ] - }, - "execution_count": 22, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "%catalog list()" ] }, { "cell_type": "code", - "execution_count": 23, + "execution_count": null, "id": "076f21a5", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "['public']" - ] - }, - "execution_count": 23, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "%catalog get_tags(\"stations\")" ] }, { "cell_type": "code", - "execution_count": 24, + "execution_count": null, "id": "32c56703", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "latest view reads the version: SELECT * FROM \"eea_lakehouse\".\"non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.versions.v2026_1\".\"stations\"\n" - ] - } - ], + "outputs": [], "source": [ "print(\"latest view reads the version:\", verify.view_sql(f\"{AREA}.stations\"))" ] @@ -743,7 +445,7 @@ }, { "cell_type": "code", - "execution_count": 62, + "execution_count": null, "id": "fd47c58f", "metadata": {}, "outputs": [], @@ -766,18 +468,10 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": null, "id": "dba0484a", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "/tmp/catalog_magic_smoke_jpk0iz9v\n" - ] - } - ], + "outputs": [], "source": [ "import tempfile\n", "\n", @@ -799,32 +493,10 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": null, "id": "b42ca6d2", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "ingest '/tmp/catalog_magic_smoke_jpk0iz9v/temps' -> 'eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.draft' (Polaris):\n", - "✓ sign-in: Keycloak user 'eea-admin'\n", - "✓ files: 1 parquet file(s), 1002 bytes\n", - "✓ target: eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.draft.temps (new)\n", - "✓ storage: s3://lakehouse/catalog/non_domain_datasets/catalog_magic_smoke_test/dfl_smoke/draft/_ingestion/eea_admin-20261201T091904Z-9e22cb/temps/ reachable (sts keys)\n", - "ingest '/tmp/catalog_magic_smoke_jpk0iz9v/samples' -> 'eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.draft' (Polaris):\n", - "✓ sign-in: Keycloak user 'eea-admin'\n", - "✓ files: 1 csv file(s), 27 bytes\n", - "✓ target: eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.draft.samples (new)\n", - "✓ storage: s3://lakehouse/catalog/non_domain_datasets/catalog_magic_smoke_test/dfl_smoke/draft/_ingestion/eea_admin-20261201T091904Z-5f48fb/samples/ reachable (sts keys)\n", - "ingest '/tmp/catalog_magic_smoke_jpk0iz9v/temps' -> 'eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.reference' (Polaris):\n", - "✓ sign-in: Keycloak user 'eea-admin'\n", - "✓ files: 1 parquet file(s), 1002 bytes\n", - "✓ target: eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.reference.temps_ro (new)\n", - "✓ storage: s3://lakehouse/catalog/non_domain_datasets/catalog_magic_smoke_test/dfl_smoke/reference/temps_ro/ reachable (sts keys)\n" - ] - } - ], + "outputs": [], "source": [ "%ingest ingest(folder=TEMPS, target_catalog_path=f\"{AREA}.draft\", data_format=\"parquet\", table_name=\"temps\")\n", "%ingest ingest(folder=SAMPLES, target_catalog_path=f\"{AREA}.draft\", data_format=\"csv\", csv_options={\"delimiter\": \";\"})\n", @@ -834,28 +506,10 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": null, "id": "f8b18f98", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "uploading 1 file(s) to s3://lakehouse/catalog/non_domain_datasets/catalog_magic_smoke_test/dfl_smoke/draft/_ingestion/eea_admin-20261201T091909Z-d1eec3/temps/\n", - " uploaded 1/1: part-1.parquet\n", - "loading into eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.draft.temps\n", - "uploading 1 file(s) to s3://lakehouse/catalog/non_domain_datasets/catalog_magic_smoke_test/dfl_smoke/draft/_ingestion/eea_admin-20261201T091910Z-09e10f/samples/\n", - " uploaded 1/1: samples.csv\n", - "loading into eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.draft.samples\n", - "uploading 1 file(s) to s3://lakehouse/catalog/non_domain_datasets/catalog_magic_smoke_test/dfl_smoke/reference/temps_ro/2026/\n", - " uploaded 1/1: part-1.parquet\n", - "created iceberg table eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.draft.temps (2 rows, 1 files)\n", - "created iceberg table eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.draft.samples (3 rows, 1 files)\n", - "created parquet table eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.reference.temps_ro (2 rows, 1 files) at s3://lakehouse/catalog/non_domain_datasets/catalog_magic_smoke_test/dfl_smoke/reference/temps_ro/\n" - ] - } - ], + "outputs": [], "source": [ "report = %ingest commit\n", "for outcome in report.outcomes:\n", @@ -866,84 +520,40 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": null, "id": "2d3e7b30", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "TableInfo(schema={'site': 'string', 'temp': 'double', 'at': 'timestamp'}, row_count=2)" - ] - }, - "execution_count": 28, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "%catalog schema(\"draft.temps\")" ] }, { "cell_type": "code", - "execution_count": 29, + "execution_count": null, "id": "2858c4fc", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "TableInfo(schema={'site': 'VARCHAR', 'temp': 'DOUBLE', 'at': 'TIMESTAMP_NS'}, row_count=2)" - ] - }, - "execution_count": 29, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "%catalog schema(\"reference.temps_ro\")" ] }, { "cell_type": "code", - "execution_count": 30, + "execution_count": null, "id": "7ca12f16", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "PolarisIngestOutcome(table='eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.reference.temps_ro', table_format='iceberg', action='promoted', rows=2, files=1, location=None, notes=[])" - ] - }, - "execution_count": 30, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "%ingest promote(f\"{AREA}.reference.temps_ro\")" ] }, { "cell_type": "code", - "execution_count": 31, + "execution_count": null, "id": "be93abcd", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "TableInfo(schema={'site': 'string', 'temp': 'double', 'at': 'timestamp'}, row_count=2)" - ] - }, - "execution_count": 31, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "%catalog schema(\"reference.temps_ro\")" ] @@ -962,21 +572,10 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": null, "id": "299b0378", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'non_domain_datasets/catalog_magic_smoke_test/dfl_smoke/deliverables'" - ] - }, - "execution_count": 32, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "(INGEST_DIR / \"readme.txt\").write_text(\"catalog magic smoke test\")\n", "%dds target(DELIVERABLES)" @@ -984,22 +583,10 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": null, "id": "959cbdc3", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "1 file(s) in non_domain_datasets/catalog_magic_smoke_test/dfl_smoke/deliverables:\n", - " readme.txt" - ] - }, - "execution_count": 33, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "%dds push(DELIVERABLES, str(INGEST_DIR / \"readme.txt\"), overwrite=True)\n", "%dds list(DELIVERABLES)" @@ -1020,41 +607,10 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": null, "id": "63146098", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "exporting 6 table(s)/view(s) from eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke to /tmp/catalog_magic_smoke_jpk0iz9v/catalog_magic_smoke.gpkg, 4 at a time\n", - "✓ 1/6 temps_ro ← eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.reference.temps_ro: attributes, 2 rows, 0.3s\n", - "✓ 2/6 temps ← eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.draft.temps: attributes, 2 rows, 0.3s\n", - "✓ 3/6 draft_stations ← eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.draft.stations: attributes, 10 rows, 0.8s\n", - "✓ 4/6 samples ← eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.draft.samples: attributes, 3 rows, 0.9s\n", - "✓ 5/6 versions_v2026_1_stations ← eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.versions.v2026_1.stations: attributes, 10 rows, 0.6s\n", - "✓ 6/6 stations ← eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.stations: attributes, 10 rows, 0.6s\n", - "done: /tmp/catalog_magic_smoke_jpk0iz9v/catalog_magic_smoke.gpkg — 6 layer(s), 37 rows in 0.9s\n" - ] - }, - { - "data": { - "text/plain": [ - "wrote /tmp/catalog_magic_smoke_jpk0iz9v/catalog_magic_smoke.gpkg — 6 layer(s):\n", - " samples ← eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.draft.samples [attributes (no geometry); 3 rows]\n", - " draft_stations ← eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.draft.stations [attributes (no geometry); 10 rows]\n", - " temps ← eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.draft.temps [attributes (no geometry); 2 rows]\n", - " temps_ro ← eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.reference.temps_ro [attributes (no geometry); 2 rows]\n", - " stations ← eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.stations [attributes (no geometry); 10 rows]\n", - " versions_v2026_1_stations ← eea_lakehouse.non_domain_datasets.catalog_magic_smoke_test.dfl_smoke.versions.v2026_1.stations [attributes (no geometry); 10 rows]" - ] - }, - "execution_count": 34, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "gpkg = %gpkg export(limit=100, filename=\"catalog_magic_smoke.gpkg\", output_dir=str(INGEST_DIR))\n", "gpkg" @@ -1073,45 +629,20 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": null, "id": "7c9af9f6", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "pushed 1 file(s) to non_domain_datasets/catalog_magic_smoke_test/dfl_smoke/deliverables:\n", - " non_domain_datasets/catalog_magic_smoke_test/dfl_smoke/deliverables/catalog_magic_smoke.gpkg" - ] - }, - "execution_count": 35, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "%dds push(DELIVERABLES, gpkg, overwrite=True)" ] }, { "cell_type": "code", - "execution_count": 72, + "execution_count": null, "id": "14fc8734", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "2 file(s) in non_domain_datasets/catalog_magic_smoke_test/dfl_smoke/deliverables:\n", - " catalog_magic_smoke.gpkg\n", - " readme.txt" - ] - }, - "execution_count": 72, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "%dds list(DELIVERABLES)" ] @@ -1137,19 +668,10 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": null, "id": "5484c544", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "context set to 'eea_lakehouse'\n", - "folder exists after cleanup: False\n" - ] - } - ], + "outputs": [], "source": [ "SCRATCH_LOCATION = verify.rest.namespace_properties(verify.parts(TEST_FOLDER)).get(\"location\")\n", "%catalog use(None)\n", @@ -1162,34 +684,15 @@ "execution_count": null, "id": "ce67120b", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "PolarisSettings(uri='https://172.28.1.6:31443/api/catalog', catalog='eea_lakehouse', client_id='root', client_secret='c4059968fcf7d35986bde938b8825ff08b1e2cc3010f84c2f7179f1e79d409d1', vended_credentials=False, s3_endpoint='http://localhost:19000', s3_region='us-east-1', s3_access_key='rustfsadmin', s3_secret_key='8aaee44a1efe51eeefd74903aceb8a63ab0b317211e622bbc7bd1435e2eada9a', ingest_bucket='', ingest_prefix='_ingestion', role_arn='arn:aws:iam:::role/eea-datalakehouse', flight_host='', flight_port=8815, dds_base_url='https://172.28.1.6:31443/dds', ca_file='/home/oesparza/datahub/EEALakeHouse.python/debugger/lakehouse-ca.crt')" - ] - }, - "execution_count": 75, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [] }, { "cell_type": "code", - "execution_count": 37, + "execution_count": null, "id": "69cde9e9", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "removed 32 leftover file(s) under s3://lakehouse/catalog/non_domain_datasets/catalog_magic_smoke_test/\n" - ] - } - ], + "outputs": [], "source": [ "from eea_datalakehouse.catalog.object_store import ObjectStore, s3_credentials\n", "\n",