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

Camilo López

09/20/2023, 4:09 PM
Hi team! It's possible to load from the catalog the parameters of a dataset?
Copy code
boat_data:
  type: pandas.CSVDataSet
  filepath: data/01_raw/ships/boat_data.csv
Something like this
catalog.load("boat_data.filepath")
?
j

Juan Luis

09/20/2023, 4:13 PM
hi @Camilo López! there's a private method for that:
Copy code
catalog._get_dataset("boat_data")._filepath
may I ask, why do you need it?
c

Camilo López

09/20/2023, 4:14 PM
I'm using the kedro mlflow hook, and in order to promote models to from one stage to another i need the model artifact parameter and stage version
👀 1
Oh maybe i was too literal, what if i need to access to another kind of parameter (not the filepath)
j

Juan Luis

09/20/2023, 4:18 PM
of course, you can stop at
catalog._get_dataset("boat_data")
to retrieve the dataset object, and access any of its properties
a

Ankita Katiyar

09/20/2023, 4:20 PM
Could you use the
config_loader
?
n

Nok Lam Chan

09/20/2023, 6:12 PM
If you need parameters that is provided in
catalog.yml
, use
config_loader["catalog"]
. If you need to access the attribute of a
DataSet
class, use
catalog.__get__dataset(<name>)
K 1