dstandish commented on a change in pull request #6850: [AIRFLOW-6296] add mssql 
odbc hook
URL: https://github.com/apache/airflow/pull/6850#discussion_r362937473
 
 

 ##########
 File path: setup.py
 ##########
 @@ -275,6 +275,7 @@ def write_version(filename: str = 
os.path.join(*["airflow", "git_version"])):
 ]
 mssql = [
     'pymssql~=2.1.1',
+    'pyodbc',
 
 Review comment:
   > nesting odbc params in extra
   
   @baolsen  i do like the idea here
   let me share my reservations.
   here is what airflow conn uri looks like without nesting:
   ```
   
'mssql-odbc://myserver?Driver=ODBC+Driver+17+for+SQL+Server&ApplicationIntent=ReadOnly&TrustedConnection=Yes'
   ```
   and with nesting under `odbc_keywords`:
   ```
   
'mssql-odbc://myserver?odbc_keywords=%7B%27Driver%27%3A+%27ODBC+Driver+17+for+SQL+Server%27%2C+%27ApplicationIntent%27%3A+%27ReadOnly%27%2C+%27TrustedConnection%27%3A+%27Yes%27%7D'
   ```
   
   with the first form, user could create conn uri , read it, and change it 
pretty easily
   
   with the second form it's not really human readable/ editable, you have to 
use `Connection.get_uri` to generate it.
   
   if there was a good reason to do it i would do it but if not i prefer the 
readability.
   
   with sqlalchemy, the connect kwargs, by design of dbapi, are passed directly 
to the method.  so there's not really a need for them in `extra`.  And i would 
say, for any pyodbc-specific params, i think it's cleaner if we just allow them 
to be passed directly to hook in initialization, like i have done with 
`trx_isolation`.
   
   the tradeoff just doesn't seem worth it to dirty up the conn uri  --- what 
are your thoughts?
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to