File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed
Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change 11import csv
2+ import importlib .util
23import json
3- import sys
44from datetime import datetime
55from pathlib import Path
66
7- # Add src directory to path for local import
8- sys .path .insert (0 , str (Path (__file__ ).parent / ".." / ".." / "src" ))
9- from snowflake .connector .secret_detector import SecretDetector
7+ # Import SecretDetector directly without package initialization
8+ secret_detector_path = (
9+ Path (__file__ ).parent
10+ / ".."
11+ / ".."
12+ / "src"
13+ / "snowflake"
14+ / "connector"
15+ / "secret_detector.py"
16+ )
17+ spec = importlib .util .spec_from_file_location ("secret_detector" , secret_detector_path )
18+ if spec is None or spec .loader is None :
19+ raise ImportError ("Could not load secret_detector module" )
20+ secret_detector_module = importlib .util .module_from_spec (spec )
21+ spec .loader .exec_module (secret_detector_module )
22+ SecretDetector = secret_detector_module .SecretDetector
1023
1124# Domains to ignore (pip/installation traffic)
1225IGNORE_DOMAINS = {
You can’t perform that action at this time.
0 commit comments