[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

KubernetesPodOperator: Invalid arguments were passed to BaseOperator

I tested master branch by putting the following in my requirements.txt:


and did a pip install -r requirements.txt

When I started the airflow webserver, I saw deprecation warnings.  I
put some additional debugging in to through an exception so that I could see the
full stacktrace:

[2018-05-29 14:00:34,419] {} ERROR - Failed to import: /Users/c-craigr/airflow2/lib/python2.7/site-packages/airflow/example_dags/
Traceback (most recent call last):
  File "/Users/c-craigr/airflow2/lib/python2.7/site-packages/airflow/", line 304, in process_file
    m = imp.load_source(mod_name, filepath)
  File "/Users/c-craigr/airflow2/lib/python2.7/site-packages/airflow/example_dags/", line 53, in <module>
  File "/Users/c-craigr/airflow2/lib/python2.7/site-packages/airflow/utils/", line 98, in wrapper
    result = func(*args, **kwargs)
  File "/Users/c-craigr/airflow2/lib/python2.7/site-packages/airflow/", line 2308, in __init__
    raise Exception("Invalid use of args or kwargs")
Exception: Invalid use of args or kwargs

If looks like, this code is the source of the exception:

k = KubernetesPodOperator(
    cmds=["bash", "-cx"],
    arguments=["echo", "10"],
    labels={"foo": "bar"},

Without my extra debugging, the deprecation warning looks like this:

[2018-05-29 14:06:27,567] {} WARNING - Could not import KubernetesPodOperator
/Users/c-craigr/airflow2/lib/python2.7/site-packages/airflow/ PendingDeprecationWarning: Invalid arguments were passed to BaseOperator. Support for passing such arguments will be dropped in Airflow 2.0. Invalid arguments were:
*args: ()
**kwargs: {'name': 'airflow-test-pod', 'image': 'ubuntu:16.04', 'labels': {'foo': 'bar'}, 'namespace': 'default', 'cmds': ['bash', '-cx'], 'arguments': ['echo', '10'], 'in_cluster': False, 'get_logs': True}

What is the correct fix for this?  It looks like a lot of operators pass in arguments which are not
processed by BaseOperator, and thus trip over this deprecation warning.


( ! ) Warning: include(msgfooter.php): failed to open stream: No such file or directory in /var/www/git/apache-airflow-development/msg03503.html on line 122
Call Stack
10.0008368792{main}( ).../msg03503.html:0

( ! ) Warning: include(): Failed opening 'msgfooter.php' for inclusion (include_path='.:/var/www/git') in /var/www/git/apache-airflow-development/msg03503.html on line 122
Call Stack
10.0008368792{main}( ).../msg03503.html:0