From 163278f3322f0bd215a27ac5c985be997f95b38d Mon Sep 17 00:00:00 2001 From: Maciej Obuchowski Date: Thu, 6 May 2021 17:59:58 +0200 Subject: [PATCH] Standarize custom facet naming (#46) * Standarize custom facet naming Signed-off-by: Maciej Obuchowski --- spec/OpenLineage.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/spec/OpenLineage.md b/spec/OpenLineage.md index bb7b9d36404d8..d830017886a41 100644 --- a/spec/OpenLineage.md +++ b/spec/OpenLineage.md @@ -82,7 +82,6 @@ Facets are pieces of metadata that can be attached to the core entities: A facet is an atomic piece of metadata identified by its name. This means that emiting a new facet whith the same name for the same entity replaces the previous facet instance for that entity entirely). It is defined as a JSON object that can be either part of the spec or custom facets defined in a different project. -Custom facets must use a distinct prefix named after the project defining them to avoid colision with standard facets defined in the [OpenLineage.json](OpenLineage.json) spec. They have a \_schemaURL field pointing to the corresponding version of the facet schema (as a JSONPointer: [$ref URL location](https://swagger.io/docs/specification/using-ref/) ). Example: https://raw.githubusercontent.com/OpenLineage/OpenLineage/main/spec/OpenLineage.json#/definitions/MyCustomJobFacet @@ -91,6 +90,16 @@ The versioned URL must be an immutable pointer to the version of the facet schem Custom facets can be promoted to the standard by including them in the spec. +#### Custom Facet Naming + +Naming of custom facets should follow pattern `{prefix}{name}{entity}Facet` PascalCased. +Prefix must be distinct identifier named after the project defining them to avoid colision with standard facets defined in the [OpenLineage.json](OpenLineage.json) spec. +Entity is the core entity for which the facet is attached. + +When attached to core entity, the key should follow pattern `{prefix}_{name}`, where both prefix and name follow snakeCase pattern. + +Example of valid name is `BigQueryStatisticsJobFacet` and it's key `bigQuery_statistics`. + ### Standard Facets #### Run Facets