Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added 'data_dict' attribute (DataDictDataset) to AbstractVersionedDat… #3737

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

noamgoldberg
Copy link

…aset

Description

Development notes

Developer Certificate of Origin

We need all contributions to comply with the Developer Certificate of Origin (DCO). All commits must be signed off by including a Signed-off-by line in the commit message. See our wiki for guidance.

If your PR is blocked due to unsigned commits, then you must follow the instructions under "Rebase the branch" on the GitHub Checks page for your PR. This will retroactively add the sign-off to all unsigned commits and allow the DCO check to pass.

Checklist

  • Read the contributing guidelines
  • Signed off each commit with a Developer Certificate of Origin (DCO)
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added a description of this change in the RELEASE.md file
  • Added tests to cover my changes
  • Checked if this change will affect Kedro-Viz, and if so, communicated that with the Viz team

@astrojuanlu
Copy link
Member

Hi @noamgoldberg, thanks for your PR ! Could you explain the rationale behind this? What problem does it solve?

@noamgoldberg
Copy link
Author

Hi @noamgoldberg, thanks for your PR ! Could you explain the rationale behind this? What problem does it solve?

I use kedro a lot for personal projects, and it's helpful to have a data dictionary attached to large datasets. For example, I like to create data_dict.yml with the feature descriptions, ranges, and general source information, to be referenced in Jupyter notebooks and used dynamically in the code (i.e. visualizations, reports). The DataDictDataset class is rather straightforward AbstractDataset, but the unique and helpful change in this PR is the enablement of the attachment of an instance of DataDictDataset to other datasets inheriting from AbstractVersionedDataset (i.e. pandas.CSVDataSet). For example, this would enable the following entry in catalog.yml:

    stocks_data:
        type: pandas.CSVDataSet
        filepath: data/01_raw/stocks.csv
        data_dict:
            dataset: yaml.YAMLDataSet
            filepath: data/01_raw/data_dict.yml

This would create a dataset stocks_data with an attached data dictionary.

@merelcht
Copy link
Member

@noamgoldberg so this data_dict basically contains metadata about the dataset?

@noamgoldberg
Copy link
Author

@merelcht yes :) I mainly use it for feature definitions and basic dataset information (i.e. author, source, location/date created)

@noamgoldberg noamgoldberg force-pushed the data_dict branch 4 times, most recently from cd32932 to f41a822 Compare March 29, 2024 00:39
…aset

Signed-off-by: Noam Goldberg <noamgoldberg2@gmail.com>
@astrojuanlu
Copy link
Member

Hi @noamgoldberg, sorry it took us so long to get back to you.

IIUC, the data_dict you propose here already exists and it's called metadata. See an example here:

https://docs.kedro.org/projects/kedro-viz/en/latest/kedro-viz_visualisation.html#visualise-layers

Please confirm if that would suit your needs. Arguably we could do a better job at documenting it, most likely here: https://docs.kedro.org/en/stable/data/data_catalog.html

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.

None yet

3 participants