Skip to content

Commit 8c561ca

Browse files
author
James Robinson
authored
Eng 5806 cannot introspect the singlestore offers table (#97)
* Switch to installing psycopg2 from source. Add mysqlclient package. * Switch to using sqlalchemy-singlestoredb for singlestoredb. * Switch to using msqlclient driver instead of pymysql for mysql, mariadb.
1 parent e0d54bb commit 8c561ca

File tree

4 files changed

+270
-80
lines changed

4 files changed

+270
-80
lines changed

noteable_magics/datasources.py

+10
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,21 @@ def bootstrap_datasource(
164164
##
165165

166166

167+
_old_to_new_package_name = {
168+
# Older-generation PostgreSQL and CRDB gate-side datasources will claim to require psycopg2-binary,
169+
# but nowadays we install / use psycopg2 source package. They both provide the same underlying
170+
# importable package, 'psycopg2'.
171+
'psycopg2-binary': 'psycopg2'
172+
}
173+
174+
167175
def ensure_requirements(datasource_id: str, requirements: List[str], allowed_to_install: bool):
168176
"""Ensure he required driver packages are installed already, or, if allowed,
169177
install them on the fly.
170178
"""
171179
for pkg in requirements:
180+
# Perhaps swap out package name?
181+
pkg = _old_to_new_package_name.get(pkg, pkg)
172182
if not is_package_installed(pkg):
173183
if not allowed_to_install:
174184
raise Exception(

0 commit comments

Comments
 (0)