title: Python cron job with docker-compose and airflow
body: <p>I'm trying to run this Pyhon function with Docker and Airflow, it should be a simple cron job but I can't make it work. I am very unexperienced with both of them.</p>
  <p>Below is my Python code and right below it is the error raised in Airflow which is running inside a Docker container.</p>
  <p>Docker version: 20.10.12
  Python 3.9</p>
  <pre><code>from airflow.operators.bash import BashOperator
  from airflow import DAG
  from airflow.operators.python_operator import PythonOperator
  from datetime import timedelta
  import datetime
  
  now = datetime.datetime.now()
  seven_days_ago = datetime.datetime.combine(datetime.datetime.today() - timedelta(7),
                                             datetime.datetime.min.time())
  
  def f_run():
      print('blabla')
      return f_run
  
  runner = f_run()
  
  default_args = {
      'owner': 'teste',
      'depends_on_past': False,
      'email': ['airflow@example.com'],
      'email_on_failure': False,
      'email_on_retry': False,
      'retries': 1,
      'retry_delay': timedelta(minutes=5),
  }
  
  
  args = {
      'owner': 'renan',
      'start_date': seven_days_ago  # make start date in the past
  }
  
  dag = DAG(
      dag_id='teste',
      default_args=args,
      schedule_interval='@daily'  # make this workflow happen every day
  )
  
  with dag:
      func = PythonOperator(
          task_id='run',
  python_callable = runner
      )
  </code></pre>
  <p>And in airflow the error raised is:</p>
  <pre><code>    raise TypeError(f'Object of type {o.__class__.__name__} '
  TypeError: Object of type function is not JSON serializable
  </code></pre>