Dev-iL commented on code in PR #69526:
URL: https://github.com/apache/airflow/pull/69526#discussion_r3564420846


##########
providers/pgvector/src/airflow/providers/pgvector/operators/pgvector.py:
##########
@@ -41,6 +40,24 @@ def __init__(self, *args, **kwargs) -> None:
 
     def _register_vector(self) -> None:
         """Register the vector type with your connection."""
+        from airflow.providers.postgres.hooks.postgres import USE_PSYCOPG3
+
+        if USE_PSYCOPG3:
+            try:
+                from pgvector.psycopg import register_vector
+            except (ImportError, ModuleNotFoundError) as err:
+                raise AirflowOptionalProviderFeatureException(
+                    "pgvector's psycopg (v3) integration is not installed. 
Please install it with "
+                    "`pip install pgvector`."
+                ) from err

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to