Disable or show only first x rows of computation on smart sample data?
I have written a custom function that takes input values and connects to a web service to pull back data.
When building my workbooks, I don't want the function to make calls to the web-service for the smart sample data every time I modify the sheet. Is there anyway, I can either:
1) restrict computation to a few rows for specific custom functions on the smart sample data?
2) disable computation on smart sample data as a whole?
Cheers!
Nikhil
-
Hi Nkihil, the design of the sample data is definitely to get updated and executed as users make updates to the workbook. This is not something that can be disabled within a workbook.
However, I can think of a couple alternatives that may help in your situation.
First, I would consider building the workbook with a restricted sample size. The default sample size is 5,000 records, perhaps this could be lowered extremely to 10 records to limit the web-service calls.
Alternatively, you could consider adding a second version of each function that does not use the web-service. You could use these to build the workbook in Datameer. Once the workbook was completed, you could use the REST API to replace all the development functions with the production (web-service enabled) functions.
-
Hi Nikhil,
To address your requirement
>When building my workbooks, I don't want the function to make calls to the web-service for the smart sample data every time I modify the sheet.
I like to propose the following approach:
Create a Custom Function which behaves different during Workbook edit and Workbook execution
If a Custom Function should avoid making calls to a web-service every time the Worksheet gets modified, the Custom Function would need to know when/where it is executed. How can this be achieved?
Pre-requirement
- Datameer Enterprise
- Distributed Environment, Cluster
Solution Proposal
- Introduce an environment variable, e.g. CUSTOM_FUNCTION=true
- Set the environment variable in <datameer-install-path/etc/das-env.sh>
- Restart the Datameer service
- Extend your Custom Plug-in to Querying Environment Variables
- Check the occurrence of the introduced DAS environment variable in your Custom Plug-in
- It now can find out if it was called during Workbook edit or during Workbook execution
- Implement a switch to prevent web-service calls made during edit time
Just let me know your thoughts about.
-
At the moment I've gone with suggestion 1: adding a dev version of the function and using REST to change it at run-time.
I will look into Suggest 2 with regards to querying the environment variables.
Basic question on that (just so my understanding is right)
At preview time, the ENV variable will be that off the Datameer server wheras at run-time it would be on the cluster nodes - correct?
Please sign in to leave a comment.
Comments
4 comments