File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 55from pathlib import Path
66
77import requests
8+ from typing import Optional
89
910
1011def get_jira_issue (issue_name : str , email : str , api_token : str ) -> tuple :
@@ -105,14 +106,14 @@ def extract_parent_issue(jira_data: dict) -> dict:
105106 return {}
106107
107108
108- def safe_get (d : dict [ str , any ], path : list [ str ] , default : any = None ) -> any :
109+ def safe_get (d : dict , path : list , default : Optional [ str ] = "Not found" ) -> str :
109110 """Safely get a value from a nested dictionary."""
110111 for key in path :
111112 if isinstance (d , dict ):
112113 d = d .get (key , default )
113114 else :
114115 return default
115- return d
116+ return d if isinstance ( d , str ) else default
116117
117118
118119def reformat_jira_data (jira_data : dict , ticket : str ) -> dict :
You can’t perform that action at this time.
0 commit comments