File tree Expand file tree Collapse file tree
examples/ingestion_with_yaml_config Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020
2121 load_dotenv ()
2222
23- apikey = os .getenv ("SIFT_API_KEY " )
23+ apikey = os .getenv ("SIFT_LOCAL_API_KEY " )
2424
2525 if apikey is None :
2626 raise Exception ("Missing 'SIFT_API_KEY' environment variable." )
3434 telemetry_config = nostromos_lv_426 ()
3535
3636 # Create a gRPC transport channel configured specifically for the Sift API
37- sift_channel_config = SiftChannelConfig (uri = base_uri , apikey = apikey )
37+ sift_channel_config = SiftChannelConfig (uri = base_uri , apikey = apikey , use_ssl = False )
3838
3939 with use_sift_channel (sift_channel_config ) as channel :
4040 # Create ingestion service using the telemetry config we loaded in
Original file line number Diff line number Diff line change @@ -23,8 +23,7 @@ def try_fast_yaml_load(path: Path) -> Dict[Any, Any]:
2323 If the CSafeLoader is not available, use the pyyaml safe loader.
2424 """
2525 with open (path , "r" ) as f :
26- try :
27- loader = yaml .CSafeLoader
28- return cast (Dict [Any , Any ], yaml .load (f .read (), Loader = loader ))
29- except AttributeError :
26+ if hasattr (yaml , "CSafeLoader" ):
27+ return cast (Dict [Any , Any ], yaml .load (f .read (), Loader = yaml .CSafeLoader ))
28+ else :
3029 return cast (Dict [Any , Any ], yaml .safe_load (f .read ()))
You can’t perform that action at this time.
0 commit comments