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
In The Case Where I'M Passing A Schedule_Fn To Add_Task In A Taskscheduler, How Do I Pass The Function Arguments?

In the case where I'm passing a schedule_fn to add_task in a TaskScheduler, how do I pass the function arguments?

  
  
Posted 2 years ago
Votes Newest

Answers 3


def watch_folder(folder, batch_size):
count = 0
classes = os.listdir(folder)
class_count = len(classes)
files = []
dirs = []
for cls in classes:
class_dir = os.path.join(folder, cls)
fls = os.listdir(class_dir)
count += len(fls)
files.append(fls)
dirs.append(class_dir)

if count >= batch_size:
    dataset = Dataset.create(project='data-repo')
    dataset.add_files(folder)
    dataset.upload()
    dataset.finalize()
    dataset.publish()

    for i in range(class_count):
        f = os.listdir(files[i])
        d = dirs[i]
        for fname in f:
            os.remove(os.path.join(d, fname))

scheduler = TaskScheduler()

scheduler.add_task(schedule_fn=watch_folder,)

  
  
Posted 2 years ago

there are other parameters for add_task as well, I'm just curious as to how do I pass the folder and batch size in the schedule_fn=watch_folder part

  
  
Posted 2 years ago

VexedCat68 , can you give a small example?

  
  
Posted 2 years ago
701 Views
3 Answers
2 years ago
one year ago
Tags