Use variables define in Shiny webapp as DSS global variables

flo1
flo1 Registered Posts: 1 ✭✭✭

Hello,

I would like to use variables define in shiny webapp as DSS global variables.

I can't convert them into a format that can pass. I get an error every time.
I have an error every time.

Does anyone have any ideas or examples ?

thank you!

*****************************************************

my code

py_run_string('

import dataiku

import pandas as pd, numpy as np

from dataiku import pandasutils as pdu

client = dataiku.api_client().get_project("m_tgo_franceshelfpriceoptimisation_20210608")

def update_global_var(variable_name, variable_value):

global_variables = client.get_variables()

print(global_variables)

global_variables["standard"][variable_name] = variable_value

client.set_variables(global_variables)

print(global_variables)

' )

## APPEL DE LA FONCTION PYTHON

main <- import_main()

main$update_global_var(variable_name = 'SELECT_31', variable_value = 'some_value')

#py_capture_output(main$update_global_var(variable_name = 'SELECT_31', variable_value = input$SELECT_31))

df_test <- reactive({ py_capture_output(main$update_global_var(variable_name = 'SELECT_31', variable_value = input$SELECT_31))})

py_capture_output(main$update_global_var(variable_name = 'SELECT_31', variable_value = df_test()))

Answers

Setup Info
    Tags
      Help me…