zhongjiajie commented on issue #6881: [AIRFLOW-6326] Sort cli commands and arg
URL: https://github.com/apache/airflow/pull/6881#issuecomment-570813787
 
 
   Finally I found out CI failed due to
   `for arg in sorted(sub['args'], key=lambda x: cls.args[x].flags[0]):`
   and the error message is
   `argument execution_date: invalid parse value: 'runme_0', see help above.`
   It's seem that argparse parse parameter in wrong index, I try to fix it but 
still failed. 😢 
   
   The more odd think is odd thing, when I only change to sort of `airflow 
tasks run` arg, if will fail the test
   ```py
   # before
   {
       'func': lazy_load_command('airflow.cli.commands.task_command.task_run'),
       'name': 'run',
       'help': "Run a single task instance",
       'args': (
           'dag_id', 'task_id', 'execution_date', 'subdir',     #  <---change 
this line
           'mark_success', 'force', 'pool', 'cfg_path',
           'local', 'raw', 'ignore_all_dependencies', 'ignore_dependencies',
           'ignore_depends_on_past', 'ship_dag', 'pickle', 'job_id', 
'interactive',),
   },
   # after
   {
       'func': lazy_load_command('airflow.cli.commands.task_command.task_run'),
       'name': 'run',
       'help': "Run a single task instance",
       'args': (
           'execution_date', 'dag_id', 'task_id', 'subdir',
           'mark_success', 'force', 'pool', 'cfg_path',
           'local', 'raw', 'ignore_all_dependencies', 'ignore_dependencies',
           'ignore_depends_on_past', 'ship_dag', 'pickle', 'job_id', 
'interactive',),
   },
   ```
   with error message `argument execution_date: invalid parse value: 
'example_bash_operator', see help above.`
   Seem that airflow pass parameter by position, no the key. But I can not 
found out where
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to