Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escaping: Escape characters +-&|!(){}[]^"~*?:\ with \, e.g. \+
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Hi, I'M Setting A

I'm setting a USER PROPERTIES using the following code
task.set_user_properties(MY_THRESHOLD={"type": int, "value": 0.85}, )Whet is the correct way to retrieve the value?
using task.get_user_properties().get('MY_THRESHOLD').get('value') requires the conversion back to int
I'm sure I'm missing something

Posted one year ago
Votes Newest

Answers 9

task.get_parameters and task.get_parameters_as_dict have the keyword argument cast which attempts to convert values back to their original type, but interestingly doesn't seem to work for properties:

` task = Task.init()

{'General': {'a': 5}, 'properties': {'x': '5'}} Hopefully would be a relatively easy extension of get_user_properties ` !

Posted one year ago

OutrageousSheep60 , it looks like it's not a bug. Internally x is stored as an int , however get_user_properties() casts it back as a string. You could open a github issue with a feature request for this 🙂

Posted one year ago

How would you use the

user properties

as part of an experiment?

I'm guessing to get the properties. I'm guessing this really depends on your needs / use-case

Posted one year ago

Thx for investigating - What is the use case for such behavior ?
How would you use the user properties as part of an experiment?

Posted one year ago

Yeah I see what you're saying. It doesn't keep it's type. This might be a bug.

Posted one year ago

I played a bit with it and got to the value. OutrageousSheep60 , please tell me if this helps you 🙂

` >>> task.set_user_properties(x=5)

{'x': {'section': 'properties', 'name': 'x', 'value': '5'}}
'5' `

Posted one year ago

You are getting a string - '5'
I want to get an int - 5

Posted one year ago

exactly - (that is how I used it in my initial code) - but if you have to convert it back to the original data type then something is broken...

Posted one year ago
9 Answers
one year ago
10 months ago