riga / law

Build large-scale task workflows: luigi + job submission + remote targets + environment sandboxing using Docker/Singularity
http://law.readthedocs.io
BSD 3-Clause "New" or "Revised" License
98 stars 41 forks source link

Autocompletion bug in law cli with certain namespaces for "SubTasks" #87

Closed pfackeldey closed 4 years ago

pfackeldey commented 4 years ago

Hi,

I recently changed my task namespace to something with an underscore, e.g.:

class TestTask(law.Task):
    task_namespace = "abit_buggy"
    param = luigi.Parameter()
    ...

class TestTaskWrapper(law.WrapperTask):
    def requires(self):
        return [TestTask.req(self, param=param) for param in params]

Now the autocompletion for law completes only the following:

law run TestTaskWrapper --abit_buggy.TestTask-param ...`

but this leads to unrecognized parameters, instead one has to do:

law run TestTaskWrapper --abit-buggy.TestTask-param ...`

which is currently unfortunately not supported by the law autocompletion.

What are your thoughts on this @riga ?

riga commented 4 years ago

I can reproduce this. Will go down that completion rabbit hole tomorrow hopefully ;)

riga commented 4 years ago

@pfackeldey Can you checkout the fix_autocompletion branch and see if the issue persists?

pfackeldey commented 4 years ago

Unfortunately it does not work yet completely.

Now the issue is the following:

How it has to be:

law run abit_buggy.TestTaskWrapper --abit-buggy.TestTask-param ...

What autocompletion currently does:

law run abit-buggy.TestTaskWrapper --abit-buggy.TestTask-param ...

So i think the point is that the "-" <-> "_" has to be only changed for the subtasks.

riga commented 4 years ago

@pfackeldey Can you give it another shot?

pfackeldey commented 4 years ago

It works! perfect!!! 🎉 🎉 🎉

riga commented 4 years ago

Finally -.-