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
Answered
Hi, I Encountered An Issue That Might Affect Others As Well: When Using "

Hi, I encountered an issue that might affect others as well:
when using " http://Task.ge t_task"- task name is explicit str (as excepted)
but when using "Task.get_tasks"- task name is one of str/partial/regex (when I was excepted to str only)
which leads to 2 problems from my side:
task name with regex chars not found (for example: task_1_+_ 2019) or can found more than excepted ---- can fix with http://re.es cape(task,name) but need to be aware of it if one task name is part of other task then will be a mismatch (for example: task1:"mytask_1" task2: "mytask_1_full" and I use Task.get_tasks("mytask_1") then task2 will be part of tasks as well)
It's not a bug, but the behavior is not as I excepted to and each developer need to know it when using this method....so if you have any other solution it would be nice

  
  
Posted 2 years ago
Votes Newest

Answers 5


IrritableJellyfish76 hmm maybe we should an an extra argument partial_name_matching=False to maintain backwards compatibility?

  
  
Posted 2 years ago

IrritableJellyfish76 point taken, suggestions on improving the interface ?

  
  
Posted 2 years ago

Hi IrritableJellyfish76
https://clear.ml/docs/latest/docs/references/sdk/task#taskget_tasks

task_name

(

str

) – The full name or partial name of the Tasks to match within the specified

project_name

(or all projects if

project_name

is

None

). This method supports regular expressions for name matching. (Optional)

You are right, this is a bit confusing, I will make sure that we add in the docstring an example of exact match. For future reference, in order to get exactly the name " exact_task_name_here " , you should pass "^exact_task_name_here$"

  
  
Posted 2 years ago

AgitatedDove14 As a user I excepted that task_name will be a str, so from my point of view, it should be explicit as same as in get_task.
one option is to validate task_name not contains any regex related chars in init phase, second option is to add explicit task_name option to the interface and not all-in-one option.

  
  
Posted 2 years ago

Thanks Martin.
I'll use this hack next time, but I think it might cause runtime issues when we use it naive way.
a different use for task_name will be more intuitive (especially when get_task works like this)

  
  
Posted 2 years ago
965 Views
5 Answers
2 years ago
one year ago
Tags