potiuk commented on code in PR #31984:
URL: https://github.com/apache/airflow/pull/31984#discussion_r1233215226
##########
airflow/providers/microsoft/mssql/hooks/mssql.py:
##########
@@ -63,11 +63,10 @@ def connection_extra_lower(self) -> dict:
@property
def sqlalchemy_scheme(self) -> str:
"""Sqlalchemy scheme either from constructor, connection extras or
default."""
- return (
- self._sqlalchemy_scheme
- or self.connection_extra_lower.get("sqlalchemy_scheme")
- or self.DEFAULT_SQLALCHEMY_SCHEME
- )
+ extra_scheme = self.connection_extra_lower.get("sqlalchemy_scheme")
+ if not self._sqlalchemy_scheme and extra_scheme and (":" in
extra_scheme or "/" in extra_scheme):
+ raise RuntimeError("sqlalchemy_scheme in connection extra should
not contain : or / characters")
+ return self._sqlalchemy_scheme or extra_scheme or
self.DEFAULT_SQLALCHEMY_SCHEME
Review Comment:
Generally, yes, and it also surprised me a bit. But I did not want to add
even more `somewhat breaking` changes at the same time. One breaking thing at a
time is breaking enough (even thought this one is technically a bugfix, not a
breaking change).
But I can be convinced otherwise if others things it would be better to make
it a breaking change as well and change the sequence.
--
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]