Ok, it seems I was able to run hello world in the python3 environment,
though there were some errors anyway, but seems finished successfully.
It would be great if someone could comment how do I get rid of those
errors below.
Also I'd like to have a bit more sofisticated hello world example if
possible.
Let's say, I need to import one table from instance1 into instance2 (say
they are both postgres), how do I achieve this with luigi?
Please advise.
$ python3
Python 3.6.9 (default, Jul 17 2020, 12:50:27)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import luigi
>>> class HelloWorldTask(luigi.Task):
... task_namespace = 'examples'
...
>>> def run(self):
File "<stdin>", line 1
def run(self):
^
IndentationError: unexpected indent
>>> print("{task} says: Hello
>>> world!".format(task=self.__class__.__name__))
File "<stdin>", line 1
print("{task} says: Hello
world!".format(task=self.__class__.__name__))
^
IndentationError: unexpected indent
>>>
>>>
>>> if __name__ == '__main__':
... luigi.run(['examples.HelloWorldTask', '--workers', '1',
'--local-scheduler'])
...
DEBUG: Checking if examples.HelloWorldTask() is complete
/home/ymarkiv/.local/lib/python3.6/site-packages/luigi/worker.py:401:
UserWarning: Task examples.HelloWorldTask() without outputs has no
custom complete() method
is_complete = task.complete()
INFO: Informed scheduler that task examples.HelloWorldTask__99914b932b
has status PENDING
INFO: Done scheduling tasks
INFO: Running Worker with 1 processes
DEBUG: Asking scheduler for work...
DEBUG: Pending tasks: 1
INFO: [pid 20605] Worker Worker(salt=641288618, workers=1,
host=marchelloG, username=ymarkiv, pid=20605) running
examples.HelloWorldTask()
INFO: [pid 20605] Worker Worker(salt=641288618, workers=1,
host=marchelloG, username=ymarkiv, pid=20605) done
examples.HelloWorldTask()
DEBUG: 1 running tasks, waiting for next task to finish
INFO: Informed scheduler that task examples.HelloWorldTask__99914b932b
has status DONE
DEBUG: Asking scheduler for work...
DEBUG: Done
DEBUG: There are no more tasks to run at this time
INFO: Worker Worker(salt=641288618, workers=1, host=marchelloG,
username=ymarkiv, pid=20605) was stopped. Shutting down Keep-Alive
thread
INFO:
===== Luigi Execution Summary =====
Scheduled 1 tasks of which:
* 1 ran successfully:
- 1 examples.HelloWorldTask()
This progress looks :) because there were no failed tasks or missing
dependencies
===== Luigi Execution Summary =====
True