create publicly accessible read only variable

Tomas
Tomas Registered, Neuron 2022 Posts: 121 ✭✭✭✭✭✭
Hi,

I would like to set on the instance level of the DSS a variable what will be readable by everyone in python. When I store something on the global variables section it is readable only by admins. Other users get:

client=dataiku.api_client()
print(client.get_variables().get('env_specific'))

dataikuapi.utils.DataikuException: com.dataiku.dip.exceptions.UnauthorizedException: Action forbidden, you are not admin

Thanks for any tips/advise,
Tagged:

Best Answer

  • Alex_Combessie
    Alex_Combessie Alpha Tester, Dataiker Alumni Posts: 539 ✭✭✭✭✭✭✭✭✭
    edited July 2024 Answer ✓

    Hi,

    You can use:


    import dataiku
    dataiku.get_custom_variables()

    Cheers,

    Alex

Answers

  • Tomas
    Tomas Registered, Neuron 2022 Posts: 121 ✭✭✭✭✭✭
    Supplem question: if I want to store a variable what is visible only for admins, how can I achieve this? Thanks
  • Alex_Combessie
    Alex_Combessie Alpha Tester, Dataiker Alumni Posts: 539 ✭✭✭✭✭✭✭✭✭
    There is no such concept as "a variable visible only for an admin" as an instance variable. You would need to emulate that behavior by creating a project accessible only to the admin group, and store your variables in there as project variables.
  • Tomas
    Tomas Registered, Neuron 2022 Posts: 121 ✭✭✭✭✭✭
    Thanks!
Setup Info
    Tags
      Help me…