1515
1616from docker .types import Mount
1717from typing import Any , Dict , Iterable , List , Optional
18- from click import command , option , confirm , pass_context , Context , Choice , prompt
19- from lean .click import LeanCommand , ensure_options
18+ from click import command , option , confirm , pass_context , Context , prompt
19+ from lean .click import LeanCommand , ensure_options , CaseInsensitiveChoice
2020from lean .components .util .json_modules_handler import config_build_for_name
2121from lean .constants import DEFAULT_ENGINE_IMAGE
2222from lean .container import container
@@ -500,7 +500,7 @@ def _configure_date_option(date_value: str, option_id: str, option_label: str) -
500500 return date_option .configure_non_interactive (date_value )
501501
502502
503- class QCDataTypeCustomChoice (Choice ):
503+ class QCDataTypeCustomChoice (CaseInsensitiveChoice ):
504504 def get_metavar (self , param , ctx = None ) -> str :
505505 choices_str = "|" .join (QCDataType .get_all_members_except ('Open Interest' ))
506506
@@ -521,7 +521,7 @@ def _replace_data_type(ctx, param, value):
521521
522522@command (cls = LeanCommand , requires_lean_config = True , allow_unknown_options = True , name = "download" )
523523@option ("--data-provider-historical" ,
524- type = Choice ([data_downloader .get_name () for data_downloader in cli_data_downloaders ], case_sensitive = False ),
524+ type = CaseInsensitiveChoice ([data_downloader .get_name () for data_downloader in cli_data_downloaders ]),
525525 help = "The name of the downloader data provider." )
526526@options_from_json (get_configs_for_options ("download" ))
527527@option ("--dataset" , type = str , help = "The name of the dataset to download non-interactively" )
@@ -530,11 +530,11 @@ def _replace_data_type(ctx, param, value):
530530@option ("--yes" , "-y" , "auto_confirm" , is_flag = True , default = False ,
531531 help = "Automatically confirm payment confirmation prompts" )
532532@option ("--data-type" , callback = _replace_data_type ,
533- type = QCDataTypeCustomChoice (QCDataType .get_all_members (), case_sensitive = False ),
533+ type = QCDataTypeCustomChoice (QCDataType .get_all_members ()),
534534 help = "Specify the type of historical data" )
535- @option ("--resolution" , type = Choice (QCResolution .get_all_members (), case_sensitive = False ),
535+ @option ("--resolution" , type = CaseInsensitiveChoice (QCResolution .get_all_members ()),
536536 help = "Specify the resolution of the historical data" )
537- @option ("--security-type" , type = Choice (QCSecurityType .get_all_members (), case_sensitive = False ),
537+ @option ("--security-type" , type = CaseInsensitiveChoice (QCSecurityType .get_all_members ()),
538538 help = "Specify the security type of the historical data" )
539539@option ("--market" , type = str ,
540540 help = "Specify the market name for tickers (e.g., 'USA', 'NYMEX', 'Binance')"
0 commit comments