Repository navigation
%catalog publish, #public release tags, folder targets and %sdi validate (ref #308994) - #108
Merged
Merged
Conversation
%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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ref #308994
%catalog publish
publish(path=None, overwrite=True, partition_by=None)copies every#publicview of a dataflow folder into"public_s3"."dh-prod-data-public".<full catalog path>.pathwhen given, otherwise the%catalog use(...)context. With neither, it raises. The folder must havedraft,versionsandreference/referencesfolders just below it.draft,versionsandreference/referencesis never copied. Views without the tag are skipped and listed in the report's notes.DROP TABLE IF EXISTS, thenCREATE TABLE … STORE AS (type => 'parquet') AS SELECT * FROM <view>, thenALTER TABLE … REFRESH METADATA AUTO PROMOTION, then aCOUNT(*)check.<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_bytakes a list of fields for every view, or a dict of fields per view. The fields are checked against the views whenpublishis called.%catalog helpdescribes what publish does, not how the tables are created.update_latest_release
#public, and removes the tag from every table and view underversions. Undo restores the removed tags.data_copy / data_move
target_pathending 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
get_xmlrecord) against the ISO 19115-3 XSD. The schemas are bundled undersdi/schemasso validation works offline, andscripts/fetch_iso19115_3_schemas.pyre-downloads them.Testing
pytest: 1071 passed, 1 skipped. The new tests are intests/catalog/test_publish.py,tests/catalog/test_session_target_folder.pyandtests/sdi/test_validation.py.CREATE TABLE,PARTITION BYandREFRESH METADATAonpublic_s3, and whether Dremio accepts the#publictag text.