title: Where did the Luigi task go?
body: <p>First time into the realm of Luigi (and Python!) and have some questions.  Relevant code is:</p>
  
  <pre><code>from Database import Database
  import luigi
  
  class bbSanityCheck(luigi.Task):
  
    conn = luigi.Parameter()
    date = luigi.Parameter()
    def __init__(self, *args, **kwargs):
      super(bbSanityCheck, self).__init__(*args, **kwargs)
      self.has_run = False
  
    def run(self):
      print "Entering run of bb sanity check"
      # DB STUFF HERE THAT DOESN"T MATTER
     print "Are we in la-la land?"
  
    def complete(self):
      print "BB Sanity check being asked for completeness: " , self.has_run
      return self.has_run
  
  class Pipeline(luigi.Task):
    date = luigi.DateParameter()
  
    def requires(self):
      db = Database('cbs')
      self.conn = db.connect()
      print "I'm about to yield!"
      return bbSanityCheck(conn = self.conn, date = self.date)
  
  
    def run(self):
      print "Hello World"
      self.conn.query("""SELECT * 
                FROM log_blackbook""")
      result = conn.store_result()
  
      print result.fetch_row()
  
    def complete(self):
      return False
  
  if __name__=='__main__':
    luigi.run()
  </code></pre>
  
  <p>Output is here (with relevant DB returns removed 'cause):</p>
  
  <pre><code>DEBUG: Checking if Pipeline(date=2013-03-03) is complete
  I'm about to yield!
  INFO: Scheduled Pipeline(date=2013-03-03)
  I'm about to yield!
  DEBUG: Checking if bbSanityCheck(conn=&lt;_mysql.connection open to 'sas1.rad.wc.truecarcorp.com' at 223f050&gt;, date=2013-03-03) is complete
  BB Sanity check being asked for completeness:  False
  INFO: Scheduled bbSanityCheck(conn=&lt;_mysql.connection open to 'sas1.rad.wc.truecarcorp.com' at 223f050&gt;, date=2013-03-03)
  INFO: Done scheduling tasks
  DEBUG: Asking scheduler for work...
  DEBUG: Pending tasks: 2
  INFO: [pid 5150] Running   bbSanityCheck(conn=&lt;_mysql.connection open to 'sas1.rad.wc.truecarcorp.com' at 223f050&gt;, date=2013-03-03)
  Entering run of bb sanity check
  Are we in la-la land?
  INFO: [pid 5150] Done      bbSanityCheck(conn=&lt;_mysql.connection open to 'sas1.rad.wc.truecarcorp.com' at 223f050&gt;, date=2013-03-03)
  DEBUG: Asking scheduler for work...
  INFO: Done
  INFO: There are no more tasks to run at this time
  INFO: There are 1 pending tasks possibly being run by other workers
  INFO: Worker was stopped. Shutting down Keep-Alive thread
  </code></pre>
  
  <p>So the questions:</p>
  
  <p>1.) Why does "I'm about to yield" get printed twice?</p>
  
  <p>2.) Why is "hello world" never printed?</p>
  
  <p>3.) What is the "1 pending tasks possibly run by other workers"?</p>
  
  <p>I prefer super-ultra clean output because it is way easier to maintain.  I'm hoping I can get these warning equivalents ironed out.</p>
  
  <p>I've also noted that requires either "yield" or "return item, item2, item3".  I've read about yield and understand it.  What I don't get is which convention is considered superior here or if their are subtle differences that I being new to the language am not getting.</p>