You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DF CX allows us to set boolean values as parameter presets in the fulfillments. The current Scrapi implementation restricts this by only allowing string value
Expected Behavior
add_parameter_presets() in the class FulfillmentBuilder should allow boolean in the parameter_map parameter. The acceptable dict should be allow dict values to be boolean so it accepts Dict[str,boolean] instead of only Dict[str,str]
The DFCX console allows us to add boolean values as the parameter preset. The SetParameterAction method from Google's DFCX API allows values of type 'any'
Current Behavior
The add_parameter_presets() in the class FulfillmentBuilder expects the parameter_map to be Dict[str,str] which results in the following ValueError when a Dict[str,boolean] is passed
"Only strings are allowed as"
" dictionary keys and values in parameter_map."
Possible Solution
Steps to Reproduce
Create a dfcx_scrapi.builders.fulfillments.FulfillmentBuilder object
Call add_parameter_presets method using the FulfillmentBuilder object
Eg. fulfillment_builder.add_parameter_presets({"var_name" : True})
Scrapi API returns raise a Value Error
Context (Environment)
We often use boolean variables to set parameter preset for various routes. Currently we have to set any decision variables as "True" or "False" which is essentially string matching and not exactly if-else condition as it's efficient
Detailed Description
Possible Implementation
The text was updated successfully, but these errors were encountered:
DF CX allows us to set boolean values as parameter presets in the fulfillments. The current Scrapi implementation restricts this by only allowing string value
Expected Behavior
add_parameter_presets() in the class FulfillmentBuilder should allow boolean in the parameter_map parameter. The acceptable dict should be allow dict values to be boolean so it accepts Dict[str,boolean] instead of only Dict[str,str]
The DFCX console allows us to add boolean values as the parameter preset. The SetParameterAction method from Google's DFCX API allows values of type 'any'
Current Behavior
The add_parameter_presets() in the class FulfillmentBuilder expects the parameter_map to be Dict[str,str] which results in the following ValueError when a Dict[str,boolean] is passed
"Only strings are allowed as"
" dictionary keys and values in parameter_map."
Possible Solution
Steps to Reproduce
Eg. fulfillment_builder.add_parameter_presets({"var_name" : True})
Context (Environment)
We often use boolean variables to set parameter preset for various routes. Currently we have to set any decision variables as "True" or "False" which is essentially string matching and not exactly if-else condition as it's efficient
Detailed Description
Possible Implementation
The text was updated successfully, but these errors were encountered: