File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
extensions/positron-python/python_files/posit/positron Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -1248,6 +1248,18 @@ def _is_active(self, value) -> bool:
12481248 return True
12491249
12501250
1251+ class RedshiftConnectionInspector (BaseConnectionInspector ):
1252+ CLASS_QNAME = ("redshift_connector.Connection" , "redshift_connector.core.Connection" )
1253+
1254+ def _is_active (self , value ) -> bool :
1255+ try :
1256+ # a connection is active if you can acquire a cursor from it
1257+ value .cursor ()
1258+ except Exception :
1259+ return False
1260+ return True
1261+
1262+
12511263class IbisExprInspector (PositronInspector ["ibis.Expr" ]):
12521264 def has_children (self ) -> bool :
12531265 return False
@@ -1290,6 +1302,7 @@ def to_plaintext(self) -> str:
12901302 ** dict .fromkeys (SnowflakeConnectionInspector .CLASS_QNAME , SnowflakeConnectionInspector ),
12911303 ** dict .fromkeys (DatabricksConnectionInspector .CLASS_QNAME , DatabricksConnectionInspector ),
12921304 ** dict .fromkeys (BigQueryConnectionInspector .CLASS_QNAME , BigQueryConnectionInspector ),
1305+ ** dict .fromkeys (RedshiftConnectionInspector .CLASS_QNAME , RedshiftConnectionInspector ),
12931306 "ibis.Expr" : IbisExprInspector ,
12941307 "boolean" : BooleanInspector ,
12951308 "bytes" : BytesInspector ,
You can’t perform that action at this time.
0 commit comments