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 Guys, I Feel Like I'M Missing Something Regarding The Way I Should Be Cloning Tasks. I Have Tasks Templates That I Want To Be Able To Clone And Dynamically Change The Package Requirements Required To Run The Said Task. I Have Tried Most Of What I Coul

Hi Guys,

I feel like I'm missing something regarding the way I should be cloning tasks. I have tasks templates that I want to be able to clone and dynamically change the package requirements required to run the said task. I have tried most of what I could think of around

task = Task.clone()
task.add_requirements()
Task.enqueue()

but I can't get the remote worker to install the said requirements. What am I missing here?

  
  
Posted 8 months ago
Votes Newest

Answers 11


Yeah we should definitely have get_requirements 🙂

  
  
Posted 8 months ago

I think it is only in get_task (and by default it is true)
I think query task does not filter the

  
  
Posted 8 months ago

LOl my pleasure - I guess we should have a link in the doc string of add_requirements to set_packages , I will tell the guys

  
  
Posted 8 months ago

was allow_archived removed from Task.query_tasks?

  
  
Posted 8 months ago

I'm assuming that task.data.script.requirements is not the right way to do this...

  
  
Posted 8 months ago

np

  
  
Posted 8 months ago

This being said, now I'm running into another issue that this seems to be "erasing" all the packages that had been set in the base task I'm cloning from. I can't find a method that would return these packages so that I could add to it?

  
  
Posted 8 months ago

Geez, I have been looking for this for a while, thanks for saving my day...again.

  
  
Posted 8 months ago

tx that's what I was doing more or less 😆

  
  
Posted 8 months ago

Hi @<1569858449813016576:profile|JumpyRaven4>

task.add_requirements()

This is the problem, if you look closely this is a class method, meant for helping the Task.init better capture python packages, it does Not change the task requirements.
To do that, use " task.set_packages "

  
  
Posted 8 months ago

"erasing" all the packages that had been set in the base task I'm cloning from. I

Set is not add, if you are calling set_packages, you are overwriting all of them with this single call.
You can however do:

task_data = task.export_task() 
requirements = task_data["script"]["requirements"]["pip"]
requirements += "new packages"
task.set_packages(requirements) 

I guess we should have get_requirements ?!

  
  
Posted 8 months ago