I have am triggering Luigi via
luigi.run(["--local-scheduler"], main_task_cls=Test(Server = ActiveServer, Database = DB))
and in my class I have:
class Test(luigi.Task):
Database = luigi.Parameter()
Server = luigi.Parameter()
but the task test can't seem to parse the parameters that I'm feeding it properly?
I am getting:
MissingParameterException: No value for 'Server' (--Server) submitted and no default value has been assigned.
As far as I know, you can not send the parameters through the main_task_cls
argument, only the class itself. Parameters could instead be sent via the cmdline_args
argument, like so:
luigi.run(
cmdline_args=["--local-scheduler",
"--server=ActiveServer",
"--database=DB"],
main_task_cls=Test)
Note also that there is the local_scheduler
keyword argument to luigi.run()
that you can use instead of sending --local-scheduler
through the cmdline_args
argument, so you get:
luigi.run(
cmdline_args=["--Server=ActiveServer",
"--Database=DB"],
main_task_cls=Test
local_scheduler=True)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With