22import logging
33import os
44from io import BytesIO
5- from typing import Dict
6- from typing import List
7- from typing import Optional
85from email .utils import parsedate_to_datetime
96
107import click
@@ -216,7 +213,7 @@ def get_hashes_from_file(path):
216213 return hashes
217214
218215
219- def index_hash_command (sha256 : str , index_as : str , family_name : Optional [ str ] ):
216+ def index_hash_command (sha256 : str , index_as : str , family_name : str | None ):
220217 try :
221218 index_operation = Index (index_as = sdk_consts .IndexType .from_str (index_as ),
222219 sha256 = sha256 ,
@@ -228,7 +225,7 @@ def index_hash_command(sha256: str, index_as: str, family_name: Optional[str]):
228225 return None , f'Index error: { e } Error occurred with hash: { sha256 } '
229226
230227
231- def index_file_command (file_path : str , index_as : str , family_name : Optional [ str ] ):
228+ def index_file_command (file_path : str , index_as : str , family_name : str | None ):
232229 if not utilities .is_supported_file (file_path ):
233230 click .echo ('File is not PE, ELF, DEX or APK' )
234231 return
@@ -243,7 +240,7 @@ def index_file_command(file_path: str, index_as: str, family_name: Optional[str]
243240
244241def index_directory_command (directory_path : str ,
245242 index_as : str ,
246- family_name : Optional [ str ] ,
243+ family_name : str | None ,
247244 ignore_directory_count_limit : bool ):
248245 indexes_results = []
249246
@@ -521,7 +518,7 @@ def notify_alerts_from_csv_command(csv_path: str):
521518 raise click .Abort ()
522519
523520
524- def _read_alerts_from_csv (csv_path : str ) -> List [ Dict [str , Optional [ str ] ]]:
521+ def _read_alerts_from_csv (csv_path : str ) -> list [ dict [str , str | None ]]:
525522 """
526523 Read alert IDs and environments from CSV file.
527524
0 commit comments