You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/04/25 01:11:08 UTC

[GitHub] [airflow] houqp opened a new pull request #8552: fix help message display for dags test subcommand

houqp opened a new pull request #8552:
URL: https://github.com/apache/airflow/pull/8552


   Without this fix, `airflow dags test` crashes with the following error:
   
   ```
       item_help = join([func(*args) for func, args in self.items])
     File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/argparse.py", line 531, in _format_action
       help_text = self._expand_help(action)
     File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/argparse.py", line 620, in _expand_help
       return self._get_help_string(action) % params
   TypeError: unsupported operand type(s) for %: 'tuple' and 'dict'
   ```
   
   ---
   Make sure to mark the boxes below before creating PR: [x]
   
   - [x] Description above provides context of the change
   - [x] Unit tests coverage for changes (not needed for documentation changes)
   - [x] Target Github ISSUE in description if exists
   - [x] Commits follow "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)"
   - [x] Relevant documentation is updated including usage instructions.
   - [x] I will engage committers as explained in [Contribution Workflow Example](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#contribution-workflow-example).
   
   ---
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
   Read the [Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines) for more information.
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] turbaszek edited a comment on pull request #8552: fix help message display for dags test subcommand

Posted by GitBox <gi...@apache.org>.
turbaszek edited a comment on pull request #8552:
URL: https://github.com/apache/airflow/pull/8552#issuecomment-619356547


   FYI flat map suggest by Kamil isn't best in terms of performance but it doesn't matter here probably.
   https://dev.to/turbaszek/flat-map-in-python-3g98


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] houqp commented on pull request #8552: fix help message display for dags test subcommand

Posted by GitBox <gi...@apache.org>.
houqp commented on pull request #8552:
URL: https://github.com/apache/airflow/pull/8552#issuecomment-619449410


   @mik-laj @zhongjiajie @potiuk please see PR #8561 for unit test.
   
   Also thanks @turbaszek for the optimization tip. Like you said not going to matter in this case, but it's good to know. I changed mik-laj's implementation to use nested list comprehension based on the blog post you shared.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] zhongjiajie commented on pull request #8552: fix help message display for dags test subcommand

Posted by GitBox <gi...@apache.org>.
zhongjiajie commented on pull request #8552:
URL: https://github.com/apache/airflow/pull/8552#issuecomment-619338725


   BTW, Kamil test is awesome.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] mik-laj commented on pull request #8552: fix help message display for dags test subcommand

Posted by GitBox <gi...@apache.org>.
mik-laj commented on pull request #8552:
URL: https://github.com/apache/airflow/pull/8552#issuecomment-619299600


   Can you add test to avoid regression? I think something similar to the one below is enough.
   ```
   tests/cli/test_cli_parser.py
   ```
   ```python
       def test_should_display_helps(self):
           parser = cli_parser.get_parser()
   
           all_command_as_args = sum([
               [[top_commaand.name]]
               if isinstance(top_commaand, cli_parser.ActionCommand)
               else [
                   [top_commaand.name, nested_command.name] for nested_command in top_commaand.subcommands
               ]
   
               for top_commaand in cli_parser.airflow_commands
           ], [])
           for cmd_args in all_command_as_args:
               with self.assertRaises(SystemExit):
                   parser.parse_args([*cmd_args, '--help'])
   ```


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] kaxil commented on pull request #8552: fix help message display for dags test subcommand

Posted by GitBox <gi...@apache.org>.
kaxil commented on pull request #8552:
URL: https://github.com/apache/airflow/pull/8552#issuecomment-619365400


   > FYI flat map suggest by Kamil isn't best in terms of performance but it doesn't matter here probably.
   > https://dev.to/turbaszek/flat-map-in-python-3g98
   
   Nice blog post @turbaszek 


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] turbaszek commented on pull request #8552: fix help message display for dags test subcommand

Posted by GitBox <gi...@apache.org>.
turbaszek commented on pull request #8552:
URL: https://github.com/apache/airflow/pull/8552#issuecomment-619356547


   FYI flat map suggest by Kamil isn't best in terms of performance but it's doesn't matter here.
   https://dev.to/turbaszek/flat-map-in-python-3g98


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #8552: fix help message display for dags test subcommand

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #8552:
URL: https://github.com/apache/airflow/pull/8552#issuecomment-619383941


    I merged it too quick - did not notice the last comment but indeed @hoqp -> tests would be awesome :)


----------------------------------------------------------------
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:
users@infra.apache.org