sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Support arbitrary key-value pairs in metadata

Open MeltyBot opened this issue 3 years ago • 4 comments

Migrated from GitLab: https://gitlab.com/meltano/sdk/-/issues/320

Originally created by @edgarrmondragon on 2022-01-29 03:25:39


Summary

According to the singer metadata spec:

A tap is free to write ANY type of metadata they feel is useful for describing fields in the schema, although several reserved keywords exist.

However, our dataclass implementation prevents the addition of arbitrary fields to the metadata by the tap developer. So, something like this is not possible:

{
  "metadata" : {
    "selected" : true,
    "some-other-metadata" : "whatever"
  },
  "breadcrumb" : ["properties", "some-field-name"]
}

Proposed benefits

Taps can emit informational metadata. This tags can be later leveraged by data catalogs and orchestrators (https://gitlab.com/meltano/meltano/-/issues/2611+).

Proposal details

As suggested above, tap devs interested in adding key-value pairs to their metadata objects would have to subclass _singer.Metadata etc. This is complicated by the use those of classes in Tap and Stream.

To avoid that, we could easily add a tags property that tap developers can fill-in with relevant metadata:

{
  "metadata" : {
    "selected" : true,
    "tags": {
      "some-other-metadata" : "whatever"
    }
  },
  "breadcrumb" : ["properties", "some-field-name"]
}

Best reasons not to build

There may be better ways to support the addition of extra metadata fields.

MeltyBot avatar Jan 29 '22 03:01 MeltyBot

This has been marked as stale because it is unassigned, and has not had recent activity. It will be closed after 21 days if no further activity occurs. If this should never go stale, please add the evergreen label, or request that it be added.

stale[bot] avatar Jul 18 '23 11:07 stale[bot]

Still open and https://github.com/meltano/sdk/labels/Accepting%20Pull%20Requests

edgarrmondragon avatar Jul 21 '23 19:07 edgarrmondragon

This has been marked as stale because it is unassigned, and has not had recent activity. It will be closed after 21 days if no further activity occurs. If this should never go stale, please add the evergreen label, or request that it be added.

stale[bot] avatar Jul 20 '24 21:07 stale[bot]