jina icon indicating copy to clipboard operation
jina copied to clipboard

Clarify parsers structure

Open JoanFM opened this issue 3 years ago • 1 comments

Parser structure polutes our CLI interface and help usage. I suggest we avoid having all the mixins in parsers and just have a parser for each object and these parsers take them from a collection of objects parameters dictionaries:

parser.add_argument(
    '--return-responses',
    action='store_true',
    default=False,
    help="If set, return results as List of Requests instead of a reduced DocArray.",
)

For instance, we could have a dictionary liike this:

# in some args_collection
return_responses_argument = {name_or_flags: '--return-responses', action: 'store_true', default: False, help='If set, return results as List of Requests instead of a reduced DocArray."'

# in each parser object:
from args_collectgion import return_responses_argument

parser.add_argument(**return_responses_argument)

JoanFM avatar Jun 01 '22 13:06 JoanFM

Objects to clarify:

  • set_flow_parser
  • set_client_parser
  • set_gateway_parser
  • set_deployment_parser
  • set_pod_parser

JoanFM avatar Jun 01 '22 13:06 JoanFM

@jina-ai/product This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 14 days

jina-bot avatar Aug 31 '22 00:08 jina-bot