Disable UserWarning in terminal

I get a UserWarning in the terminal when using my app:

UserWarning: Operand 'foo' is found in the params. Did you mean to use Lookup('foo') instead?

I am absolutely sure I don’t want to use Lookup in this case. Can I disable this Warning?

Hi Reinout,

UserWarnings can not be disabled. Generally, it is a good idea to solve the warnings generated by the app.
If you need help with this, let me know.

Hi Reinout,

We are trying to understand your situation. What are you trying to do with ‘foo’?

Is ‘foo’ a paramater used in a Visibility argument or similar?
or, are you doing a string compare somwhere, were the string happens to match a parameter name?

In the second case , the warning is a false positive and we should consider removing it.

I have a dictionary

default_values ={"foo": 16}

I let the user choose if he wants to use the default dictionary or a manual input. If the input is default I use an OutputField to show the corresponding value in the dictionary. If the user wants to override he gets a NumberField.

option = BooleanField("manual input?")
foo_automatic = OutputField("foo value", value=FunctionLookup(get_default_value, "foo"), visible=Lookup("option"))
foo_manual = NumberField("foo value", name="foo", visible=IsFalse(Lookup("option")), default=default_values["foo"])

def get_default_value(key: str):
   return default_values[key]

If I didn’t mess up something in this simplification this wil give the above described UserWarning. I added the FunctionLookup because I use that for something else and I am not sure if it is related.