[SOLVED] Hey! Can I inject a custom dataset when u...
# plugins-integrations
n
[SOLVED] Hey! Can I inject a custom dataset when using kedro boot? @Takieddine Kadiri
t
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
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
You’re using kedro-boot 0.1.0 with kedro < 0.19 ?
n
Yeah using
Copy code
kedro==0.18.14
kedro-boot==0.1.0
t
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
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
Thank you for the feedback ! Enjoy 🥳