https://kedro.org/ logo
#questions
Title
# questions
m

Michel van den Berg

07/07/2023, 1:50 PM
In the data catalog, can we add extra metadata to a dataset?
d

Deepyaman Datta

07/07/2023, 1:55 PM
n

Nok Lam Chan

07/07/2023, 2:07 PM
Yes! Let me find if the doc is ready. We just added this recently.
You can find some example here: https://github.com/kedro-org/kedro-plugins/pull/189#issuecomment-1523740768 The official ticket for adding doc is still open: https://github.com/kedro-org/kedro/issues/2689 This should be a good starting point if you need to consume the
metadata
. To define your metadata, it’s just a key-value pair in your
catalog.yml
Copy code
class MetadataHooks:
    @hook_impl
    def after_catalog_created(self,
        catalog: DataCatalog,
        conf_catalog: Dict[str, Any],
        conf_creds: Dict[str, Any],
        feed_dict: Dict[str, Any],
        save_version: str,
        load_versions: Dict[str, str],
    ):
        for k,v in catalog.datasets.__dict__.items():
            print(k + "metadata: \n" + str(v.metadata))
👍 1