File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22Extracts schema information from a SQL database with comprehensive error handling.
33"""
44
5- from typing import Dict , List , Any
5+ from typing import Any , Dict , List
66
77from sqlalchemy import create_engine , inspect
88from sqlalchemy .exc import SQLAlchemyError
Original file line number Diff line number Diff line change @@ -128,10 +128,10 @@ def get_api_key_from_config() -> str:
128128 return line .split (":" , 1 )[1 ].strip ()
129129 except PermissionError :
130130 print ("Error: No permission to read the config file." )
131- raise SystemExit (1 )
131+ raise SystemExit (1 ) from None
132132 except Exception as e :
133133 print (f"Error reading config: { e } " )
134- raise SystemExit (1 )
134+ raise SystemExit (1 ) from None
135135
136136 # Prompt for new API key
137137 apikey = input ("Enter your HuggingFace API key: " ).strip ()
@@ -181,7 +181,7 @@ def main() -> None:
181181
182182 except Exception as e :
183183 print (f"Error: { e } " )
184- raise SystemExit (1 )
184+ raise SystemExit (1 ) from None
185185
186186
187187if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments