1313
1414from langchain_vectorize .retrievers import VectorizeRetriever
1515
16+ logger = logging .getLogger (__name__ )
17+
1618
1719@pytest .fixture (scope = "session" )
1820def api_token () -> str :
@@ -35,7 +37,7 @@ def org_id() -> str:
3537@pytest .fixture (scope = "session" )
3638def environment () -> Literal ["prod" , "dev" , "local" , "staging" ]:
3739 env = os .getenv ("VECTORIZE_ENV" , "prod" )
38- if env not in [ "prod" , "dev" , "local" , "staging" ] :
40+ if env not in { "prod" , "dev" , "local" , "staging" } :
3941 msg = "Invalid VECTORIZE_ENV environment variable."
4042 raise ValueError (msg )
4143 return env
@@ -78,7 +80,7 @@ def pipeline_id(api_client: v.ApiClient, org_id: str) -> Iterator[str]:
7880 ],
7981 )
8082 source_connector_id = response .connectors [0 ].id
81- logging .info ("Created source connector %s" , source_connector_id )
83+ logger .info ("Created source connector %s" , source_connector_id )
8284
8385 uploads_api = v .UploadsApi (api_client )
8486 upload_response = uploads_api .start_file_upload_to_connector (
@@ -109,19 +111,19 @@ def pipeline_id(api_client: v.ApiClient, org_id: str) -> Iterator[str]:
109111 msg = "Upload failed:"
110112 raise ValueError (msg )
111113 else :
112- logging .info ("Upload successful" )
114+ logger .info ("Upload successful" )
113115
114116 ai_platforms = connectors_api .get_ai_platform_connectors (org_id )
115117 builtin_ai_platform = next (
116118 c .id for c in ai_platforms .ai_platform_connectors if c .type == "VECTORIZE"
117119 )
118- logging .info ("Using AI platform %s" , builtin_ai_platform )
120+ logger .info ("Using AI platform %s" , builtin_ai_platform )
119121
120122 vector_databases = connectors_api .get_destination_connectors (org_id )
121123 builtin_vector_db = next (
122124 c .id for c in vector_databases .destination_connectors if c .type == "VECTORIZE"
123125 )
124- logging .info ("Using destination connector %s" , builtin_vector_db )
126+ logger .info ("Using destination connector %s" , builtin_vector_db )
125127
126128 pipeline_response = pipelines .create_pipeline (
127129 org_id ,
@@ -148,14 +150,14 @@ def pipeline_id(api_client: v.ApiClient, org_id: str) -> Iterator[str]:
148150 ),
149151 )
150152 pipeline_id = pipeline_response .data .id
151- logging .info ("Created pipeline %s" , pipeline_id )
153+ logger .info ("Created pipeline %s" , pipeline_id )
152154
153155 yield pipeline_id
154156
155157 try :
156158 pipelines .delete_pipeline (org_id , pipeline_id )
157159 except Exception :
158- logging .exception ("Failed to delete pipeline %s" , pipeline_id )
160+ logger .exception ("Failed to delete pipeline %s" , pipeline_id )
159161
160162
161163def test_retrieve_init_args (
0 commit comments