Using the latest version of file in an API
Hi all,
I have a python script that is deployed as an API using Dataiku's API designer.
The python script uses a csv file for some computations. This file is present in a managed folder of my project.
There are cases when this file is changed. To make the Python API use the latest version of this file, I have to redeploy my API every time.
Is there a way to make the Python API use the latest version of the file present in the managed folder without the user redeploying the script?
Operating system used: Windows
Best Answer
-
JordanB Dataiker, Dataiku DSS Core Designer, Dataiku DSS Adv Designer, Registered Posts: 297 Dataiker
Hi @Usersyed
,To automate this process, you could create a Scenario (triggered by a dataset or folder change) and use the following scenario steps:
1. Create API service version
2. Update API deployment
Unfortunately, there is no way to have the file API use a new version of the dataset without performing an update.
Hope this helps!
Thanks,
Jordan
Answers
-
@JordanB
I tried following the steps mentioned here :
https://knowledge.dataiku.com/latest/courses/mlops/real-time-apis/manage-multiple-api-service-versions-hands-on.html
The API is getting updated on uploading a new version of file in the managed folder.
However, I don't see the change reflecting when I make the API call.
Can you please help me this?
Thanks -
@JordanB
I activated the scenario and its working now.
But the problem is that I have to run the scenario manually everytime by going to the project.
What are the configuration changes I should make to automate this i.e, update the API without the user running the scenario? -
Yes, you understood it correctly.
Update: Thanks for your help. The issue is resolved now.
I had set the scenario rerun time a bit high, hence couldn't see the changes quickly.
Its working fine now. -
JordanB Dataiker, Dataiku DSS Core Designer, Dataiku DSS Adv Designer, Registered Posts: 297 Dataiker
Nice! Glad to hear that it is working now