-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
correctly replace database name in query #7585
Conversation
9cf54a3
to
b5c9d7b
Compare
from sqlalchemy import create_engine | ||
|
||
if not self.engine.dialect.name == "postgresql": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could also use https://sqlalchemy-utils.readthedocs.io/en/latest/_modules/sqlalchemy_utils/functions/database.html#create_database but that only supports mysql in addition which doesn't seem worth to include it as extra library (login_db
doesn't make sense for sqlite)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for a super quick fix 🙏
rasa/core/tracker_store.py
Outdated
from sqlalchemy import create_engine | ||
|
||
if not self.engine.dialect.name == "postgresql": | ||
rasa.shared.utils.io.raise_warning( | ||
f"The parameter 'login_db' can only be used with a postgres database.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems a bit a wrong place to warn about login_db
, since it was passed as login_db
in the constructor of SQLTrackerStore
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's called from the constructor, no? And we can only safely determine the dialect once we're connected 🤷🏻
b5c9d7b
to
f15a1a0
Compare
Proposed changes:
sqlalchemy.text
constructStatus (please check what you already did):
black
(please check Readme for instructions)