Add option to specify deployed fuctions as public #645
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is intended to be used with the tableau Custom Function Explorer. Functions that are specified as public will be shown in tableau with helpful instructions about their usage. Functions with isPublic set to False, or unset, will be available to use, but not viewable in Tableau.
Example function:
With a tabpy server running on 9004, open a terminal, start python and input the following. This will define a function called detectLanguage, as well as a helpful schema that describes its use.
Next, we deploy the function. Notice that we have a new argument, called isPublic which in this case we have set to true.
client.deploy('detectLanguage', detectLanguage, 'Detects the language of a given input', schema=detectLanguageSchema, isPublic=True, override=False)
Here is what we see when we navigate to localhost:9004:
![Screenshot 2024-09-06 at 7 41 29 AM](https://private-user-images.githubusercontent.com/37249590/365205796-b70eb8cc-4382-468f-856c-9c206195182e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU4OTE2OTIsIm5iZiI6MTcyNTg5MTM5MiwicGF0aCI6Ii8zNzI0OTU5MC8zNjUyMDU3OTYtYjcwZWI4Y2MtNDM4Mi00NjhmLTg1NmMtOWMyMDYxOTUxODJlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA5VDE0MTYzMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThiMmNmNWEwMGNlMmU2NWE1NjQ4ZmMyNWExNGRkZDNlYjU1YjgxYmU2OGI1ZjAxZjk4N2M4ZmMyYmY1NDQzOTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.hOoHvdQiXjaGDqPmkl9_75IBUEQSeRSQIFG4yfOv2d8)
Here is what we see from the tableau Custom Functions Explorer when connected to localhost:9004:
![Screenshot 2024-09-06 at 7 42 25 AM](https://private-user-images.githubusercontent.com/37249590/365205965-b6e758b6-0bfe-43ff-87a5-a51bd2c3e028.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU4OTE2OTIsIm5iZiI6MTcyNTg5MTM5MiwicGF0aCI6Ii8zNzI0OTU5MC8zNjUyMDU5NjUtYjZlNzU4YjYtMGJmZS00M2ZmLTg3YTUtYTUxYmQyYzNlMDI4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA5VDE0MTYzMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM5OGVlOTVkM2U4NDZjN2RmNWRhYWRjMjU4N2I1MjU5NTg1Nzk3ZjdiNDg2YmYzNjVjMzJjOTJlMjg3MWJkNGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.pzc8eFTJJTX3T3Et6DmBEX3opxum2Wb4-nRQa1i0Hkc)
If we would like to update the function to not be visible, we will redeploy: Notice that isPublic is set to False, and override is set to True:
client.deploy('detectLanguage', detectLanguage, 'Detects the language of a given input', schema=detectLanguageSchema, isPublic=False, override=True)
Here is what we see when we navigate to localhost:9004:
![Screenshot 2024-09-06 at 7 43 13 AM](https://private-user-images.githubusercontent.com/37249590/365206241-15700adb-8cfb-4f95-a5b7-c7fa36006f99.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU4OTE2OTIsIm5iZiI6MTcyNTg5MTM5MiwicGF0aCI6Ii8zNzI0OTU5MC8zNjUyMDYyNDEtMTU3MDBhZGItOGNmYi00Zjk1LWE1YjctYzdmYTM2MDA2Zjk5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA5VDE0MTYzMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBmOWU5MmM3ZDg5YWRkNGRjYmVhMDlmMzJkZWRiM2E0MjI2MDFjMGYwYmRlZGRhMjAwZTE2NjhkMzY2OTBiOTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.ojbbqjed71Jjs1Ye43roVOsOxS-xLlzjz_S7HrlXWMs)
Here is what we see from the tableau Custom Functions Explorer when connected to localhost:9004:
![Screenshot 2024-09-06 at 7 43 40 AM](https://private-user-images.githubusercontent.com/37249590/365206345-105d2c77-94d6-4480-8b72-db902b519847.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU4OTE2OTIsIm5iZiI6MTcyNTg5MTM5MiwicGF0aCI6Ii8zNzI0OTU5MC8zNjUyMDYzNDUtMTA1ZDJjNzctOTRkNi00NDgwLThiNzItZGI5MDJiNTE5ODQ3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA5VDE0MTYzMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNlZjFkOGRmY2ZjMjRkYjQ5M2U2M2NjMDEwZDcxOTFhOTMyNmY4ODAyZDU0NmYzZDQxODczN2RhMTUyYTYzZjQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.yRMko4JTZMMWKSDFxn751EbLh9cLNlfoHkzGgKwBTT0)