Skip to content

%catalog publish, #public release tags, folder targets and %sdi validate (ref #308994) - #108

Merged
oskaresparza merged 6 commits into
developmentfrom
sdi_validate
Oct 26, 2026
Merged

oskaresparza merged 6 commits into
developmentfrom
sdi_validate

Conversation

@oskaresparza

Copy link
Copy Markdown
Collaborator

Ref #308994

%catalog publish

publish(path=None, overwrite=True, partition_by=None) copies every #public view of a dataflow folder into "public_s3"."dh-prod-data-public".<full catalog path>.

  • The dataflow folder is path when given, otherwise the %catalog use(...) context. With neither, it raises. The folder must have draft, versions and reference/references folders just below it.
  • Anything inside draft, versions and reference/references is never copied. Views without the tag are skipped and listed in the report's notes.
  • For each view: DROP TABLE IF EXISTS, then CREATE TABLE … STORE AS (type => 'parquet') AS SELECT * FROM <view>, then ALTER TABLE … REFRESH METADATA AUTO PROMOTION, then a COUNT(*) check.
  • All or nothing. Existing targets are backed up first, to <dataflow path>__publish_backup. If any table fails, everything the publish did is rolled back, the replaced tables are restored, and an error names the table that failed.
  • partition_by takes a list of fields for every view, or a dict of fields per view. The fields are checked against the views when publish is called.
  • %catalog help describes what publish does, not how the tables are created.

update_latest_release

  • Tags each view it creates #public, and removes the tag from every table and view under versions. Undo restores the removed tags.

data_copy / data_move

  • A target_path ending in / is a folder. The folder is created if it's missing, the table lands inside it under the source's name, and undo removes the folders it created.

%sdi validate

  • Checks a metadata file (a path, XML bytes or a get_xml record) against the ISO 19115-3 XSD. The schemas are bundled under sdi/schemas so validation works offline, and scripts/fetch_iso19115_3_schemas.py re-downloads them.
  • Checks the XSD only; Schematron rules are not checked.

Testing

  • pytest: 1071 passed, 1 skipped. The new tests are in tests/catalog/test_publish.py, tests/catalog/test_session_target_folder.py and tests/sdi/test_validation.py.
  • Not yet run against the real Dremio: publish's Parquet CREATE TABLE, PARTITION BY and REFRESH METADATA on public_s3, and whether Dremio accepts the #public tag text.

oskaresparza and others added 6 commits October 21, 2026 14:47
%dds list and get, and valid folders in every folder error (ref #309773)
Release 0.1.36: %dds list and get (ref #309773)
…alidate, ref #308994

- %catalog publish(path=None, overwrite=True, partition_by=None): copy every
  #public view of a dataflow folder (draft, versions and reference below it)
  to "public_s3"."dh-prod-data-public".<full catalog path> as Parquet tables.
  Each table is dropped first, refreshed and checked with a COUNT(*); the
  publish is all or nothing (existing tables are backed up and restored on
  failure). partition_by fields are checked against the views at once.
- update_latest_release tags the views it creates #public and removes the
  tag from everything under versions.
- data_copy/data_move: a target ending in / is a folder, created if missing.
- %sdi validate: check a metadata file against the ISO 19115-3 XSD, bundled
  under sdi/schemas so it works offline.

Redmine-Hook: v1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant