File tree Expand file tree Collapse file tree 2 files changed +381
-13
lines changed
Expand file tree Collapse file tree 2 files changed +381
-13
lines changed Original file line number Diff line number Diff line change @@ -1594,6 +1594,13 @@ def _connection_kwargs_keys(self) -> t.Set[str]:
15941594 base_keys .discard ("conn_properties" )
15951595
15961596 elif self .driver == "mssql-python" :
1597+ base_keys .update (
1598+ {
1599+ "trust_server_certificate" ,
1600+ "encrypt" ,
1601+ "odbc_properties" ,
1602+ }
1603+ )
15971604 # Remove pymssql-specific parameters
15981605 base_keys .discard ("tds_version" )
15991606 base_keys .discard ("conn_properties" )
@@ -1637,9 +1644,9 @@ def connect_mssql_python(**kwargs: t.Any) -> t.Callable:
16371644 conn_str_parts .append (f"Database={ database } " )
16381645
16391646 # Add security options
1640- conn_str_parts .append (f"Encrypt={ 'YES ' if encrypt else 'NO ' } " )
1647+ conn_str_parts .append (f"Encrypt={ 'yes ' if encrypt else 'no ' } " )
16411648 if trust_server_certificate :
1642- conn_str_parts .append ("TrustServerCertificate=YES " )
1649+ conn_str_parts .append ("TrustServerCertificate=yes " )
16431650
16441651 conn_str_parts .append (f"ConnectRetryCount={ login_attempts } " )
16451652 conn_str_parts .append (f"ConnectRetryInterval={ min (int (login_timeout ), 60 )} " )
You can’t perform that action at this time.
0 commit comments