https://kedro.org/ logo
Title
a

anhoang

08/19/2021, 9:16 PM
@User I just whipped up the miinimal code snippet to go from the Dataset Class object to yaml string representation. Will need to modify for custom Datasets, but it's a start! 🙂
python
import inspect

from kedro.extras.datasets.pandas import CSVDataSet

full_class_name = inspect.getclasstree([CSVDataSet])[-1][0][0] #kedro.extras.datasets.pandas.csv_dataset.CSVDataSet

full_class_name_str = str(full_class_name) #<class 'kedro.extras.datasets.pandas.csv_dataset.CSVDataSet'>

yaml_class_str = full_class_name_str.partition("kedro.extras.datasets.")[-1].strip("'>") 

print(yaml_class_str) #pandas.csv_dataset.CSVDataSet