astronomer / airflow-provider-great-expectations

Great Expectations Airflow operator
http://greatexpectations.io
Apache License 2.0
157 stars 53 forks source link

Case-sensitive code for ODBC Driver extras #123

Open tereselarsson opened 8 months ago

tereselarsson commented 8 months ago

I'm using the ODBC Driver 18 for SQL Server and have it listed as an extra under "Driver:" in my Airflow connection - this would be correct if the source code for the method 'make_connection_configuration' in great_expectations.py didn't specify that the extra should be a lower-case "driver". As soon as I noticed this detail and changed it in my connection the GXOperator works perfectly. To prevent this problem from occuring the code should be changed to allow variations in writing of the "driver" extra.

...
 elif conn_type == "mssql":
                odbc_connector = "mssql+pyodbc"
                ms_driver = self.conn.extra_dejson.get("driver") or "ODBC Driver 17 for SQL Server"
                driver = f"?driver={ms_driver}"
                database_name = self.conn.schema or "master"
...