dabla commented on issue #44902:
URL: https://github.com/apache/airflow/issues/44902#issuecomment-2541841572

   Those where the changes I made, still can't figure out how this would have 
impacted the encoding issue:
   
   ```
       @property
       def connection(self):
           """The Connection object with ID ``odbc_conn_id``."""
           if not self._connection:
               self._connection = self.get_connection(self.get_conn_id())
           return self._connection
   
       @property
       def connection_extra_lower(self) -> dict:
           """
           ``connection.extra_dejson`` but where keys are converted to lower 
case.
   
           This is used internally for case-insensitive access of odbc params.
           """
           return {k.lower(): v for k, v in 
self.connection.extra_dejson.items()}
   
       @property
       def odbc_connection_string(self):
           """
           ODBC connection string.
   
           We build connection string instead of using ``pyodbc.connect`` params
           because, for example, there is no param representing
           ``ApplicationIntent=ReadOnly``.  Any key-value pairs provided in
           ``Connection.extra`` will be added to the connection string.
           """
           if not self._conn_str:
               conn_str = ""
               if self.driver:
                   conn_str += f"DRIVER={{{self.driver}}};"
               if self.dsn:
                   conn_str += f"DSN={self.dsn};"
               if self.connection.host:
                   conn_str += f"SERVER={self.connection.host};"
               database = self.database or self.connection.schema
               if database:
                   conn_str += f"DATABASE={database};"
               if self.connection.login:
                   conn_str += f"UID={self.connection.login};"
               if self.connection.password:
                   conn_str += f"PWD={self.connection.password};"
               if self.connection.port:
                   conn_str += f"PORT={self.connection.port};"
   
               extra_exclude = {"driver", "dsn", "connect_kwargs", 
"sqlalchemy_scheme", "placeholder"}
               extra_params = {
                   k: v for k, v in **self.connection.extra_dejson.items()** if 
k.lower() not in extra_exclude
               }
               for k, v in extra_params.items():
                   conn_str += f"{k}={v};"
   
               self._conn_str = conn_str
           return self._conn_str
   ```


-- 
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