https://kedro.org/ logo
#plugins-integrations
Title
# plugins-integrations
n

Nils Romanus

02/09/2024, 11:00 AM
[SOLVED] Hey! Can I inject a custom dataset when using kedro boot? @Takieddine Kadiri
t

Takieddine Kadiri

02/09/2024, 11:48 AM
Hi, you can inject any object into any dataset. What are trying to achieve ? you want to inject data into kedro project or kedro package ? You need to embed your app inside kedro project or want to keep it external ? Here is an example of injecting data from external application into kedro project :
Copy code
from kedro_boot.app.booter import boot_project
from kedro_boot.framework.compilation.specs import CompilationSpec
session = boot_project(project_path="<your_project_path>", compilation_specs=[CompilationSpec(inputs=["your_dataset_name"])], kedro_args={"pipeline": "your_pipeline", conf_source="<your_conf_source>", ....})
run_results = session.run(inputs={"your_dataset_name": your_injected_data})
For now try installing kedro boot directly from the main branch. We’ll release the new version in the next days
n

Nils Romanus

02/09/2024, 11:54 AM
Hi! Thank you for the response. I love the plugin! I am running kedro boot in embedded mode like the spaceflights_fastapi example. I want to be able to send a request a request that specifies the path that defines the path of a
PartitionedDataset
Copy code
#catalog.yml
documents:
  type: PartitionedDataset
  path: data/01_raw/ <-want to specify this in request
  dataset:
    type: embeddings.extras.datasets.document_dataset.DocumentDataSet <- this is a custom dataset
    load_args: 
...
Is this possible?
t

Takieddine Kadiri

02/09/2024, 11:58 AM
You’re using kedro-boot 0.1.0 with kedro < 0.19 ?
n

Nils Romanus

02/09/2024, 11:59 AM
Yeah using
Copy code
kedro==0.18.14
kedro-boot==0.1.0
t

Takieddine Kadiri

02/09/2024, 12:06 PM
You need to inject your data through
template_params
Session.run(template_params={path_param: <your_path>})
In your catalog.yml try to parametrize your path attribute:
Path: ‘[[path_param]]’
n

Nils Romanus

02/09/2024, 12:07 PM
aaah okey okey that makes sense. Im not "injecting a dataset" rather im just changing the catalog based on request. Going to try this
👍 1
Wow! It works. Thank you very much. Once again, great plugin! 🤗
🥳 1
t

Takieddine Kadiri

02/09/2024, 12:25 PM
Thank you for the feedback ! Enjoy 🥳