Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gokart.build() cannot process task parameter #228

Open
mski-iksm opened this issue Aug 7, 2021 · 3 comments
Open

gokart.build() cannot process task parameter #228

mski-iksm opened this issue Aug 7, 2021 · 3 comments

Comments

@mski-iksm
Copy link
Contributor

Task parameters can be set at gokart.run() as following example.

gokart.run(['SampleTask', '--local-scheduler', '--param=hello'])

When using gokart.build() this is not possible, which makes changing parameters bothersome.

@vaaaaanquish
Copy link
Contributor

Is there a scene where you want to dynamically change the parameters of an instantiated class?

x = GokartTask(task_parameter=1)   <- we can change

gokart.build(x)

@mski-iksm
Copy link
Contributor Author

@vaaaaanquish
I believe that the parameter injection feature will be needed when

  • the root task (RootTask) has required task (ChildTask)
  • and the parameter of required task (ChildTask) is not passed from root task
class ChildTask(TaskOnKart):
    task_parameter2:int = luigi.IntParameter()


class RootTask(TaskOnKart):
    task_parameter:int = luigi.IntParameter()
    def requires(self):
        return ChildTask()

x = RootTask(task_parameter=1)
gokart.build(x)

In such case, ChildTask.task_parameter2 must be set somehow.
I think this may happen sometimes.

@vaaaaanquish
Copy link
Contributor

I see the demand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants