Skip to content

Commit

Permalink
fix deepsource issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ricwo committed Mar 17, 2020
1 parent 26ae27c commit 873d344
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
14 changes: 11 additions & 3 deletions rasa/cli/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,24 @@
def add_subparser(
subparsers: argparse._SubParsersAction, parents: List[argparse.ArgumentParser]
) -> None:
shell_parser = subparsers.add_parser(
"""Add subparser for `rasa export`.
Args:
subparsers: Subparsers action object to which `argparse.ArgumentParser`
objects can be added.
parents: `argparse.ArgumentParser` objects whose arguments should also be
included.
"""
export_parser = subparsers.add_parser(
"export",
parents=parents,
conflict_handler="resolve",
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
help="Export conversations using an event broker.",
)
shell_parser.set_defaults(func=export_trackers)
export_parser.set_defaults(func=export_trackers)

arguments.set_export_arguments(shell_parser)
arguments.set_export_arguments(export_parser)


def _get_tracker_store(endpoints: "AvailableEndpoints") -> "TrackerStore":
Expand Down
4 changes: 2 additions & 2 deletions rasa/core/brokers/pika.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def _get_queues_from_args(
if queues_arg and isinstance(queues_arg, (list, tuple)):
return queues_arg

elif queues_arg and isinstance(queues_arg, str):
if queues_arg and isinstance(queues_arg, str):
logger.debug(
f"Found a string value under the `queues` key of the Pika event broker "
f"config. Please supply a list of queues under this key, even if it is "
Expand All @@ -324,7 +324,7 @@ def _get_queues_from_args(
if queue_arg and isinstance(queue_arg, str):
return [queue_arg]

elif queue_arg:
if queue_arg:
return queue_arg # pytype: disable=bad-return-type

raise ValueError(
Expand Down

0 comments on commit 873d344

Please sign in to comment.