-
Notifications
You must be signed in to change notification settings - Fork 590
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
BUG: fix datamgr.py fail if IBIS_TEST_OMNISCIDB_DATABASE=omnisci #2057
Conversation
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.
@anmyachev good catch! and thanks for work on that.
maybe you can refactor that a little bit:
- you can remove the else statement you added and
- add a similar code before
if(between line 348 and 349) - and remove
database = params["database"]from line 358
eg:
default_db = 'omnisci'
database = params["database"]
if params['database'] != default_db:
conn = pymapd.connect(
host=params['host'],
user=params['user'],
password=params['password'],
port=params['port'],
dbname=default_db,
protocol=params['protocol'],
)
stmt = "DROP DATABASE IF EXISTS {}".format(database)
try:
conn.execute(stmt)
except Exception:
logger.warning('OmniSci DDL statement %r failed', stmt)
stmt = 'CREATE DATABASE {}'.format(database)
try:
conn.execute(stmt)
except Exception:
logger.exception('OmniSci DDL statement %r failed', stmt)
conn.close()
conn = pymapd.connect(
host=params['host'],
user=params['user'],
password=params['password'],
port=params['port'],
dbname=database,
protocol=params['protocol'],
)
91a2ad3
to
7b976fa
Compare
|
@xmnlab the PR ready for review |
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.
LGTM! thanks for working on that @anmyachev
|
@anmyachev could you add a release note for that pls? thanks! |
|
@xmnlab release note was be added. Thanks for review! |
|
Thanks @anmyachev ! |
closes #2049