feluelle commented on code in PR #28721:
URL: https://github.com/apache/airflow/pull/28721#discussion_r1159442863
##########
airflow/providers/sqlite/hooks/sqlite.py:
##########
@@ -33,13 +34,21 @@ class SqliteHook(DbApiHook):
def get_conn(self) -> sqlite3.dbapi2.Connection:
"""Returns a sqlite connection object"""
- conn_id = getattr(self, self.conn_name_attr)
- airflow_conn = self.get_connection(conn_id)
- conn = sqlite3.connect(airflow_conn.host)
+ # The sqlite3 connection does not use the sqlite scheme and path
should not end with a slash.
+ # See
https://docs.sqlalchemy.org/en/14/dialects/sqlite.html#uri-connections for
details.
+ sqlalchemy_uri = self.get_uri()
+ sqlite_uri = sqlalchemy_uri.replace("sqlite:///",
"file:").replace("/?", "?")
Review Comment:
I am not quite sure, because the URI format of an airflow connection is
different from the one [SQLite uses](https://www.sqlite.org/uri.html).
--
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]