It looks like sqlalchemy.create_engine() can be called without a database name, as a quick way to get dialect information (without an actual database connection.
Traceback (most recent call last):
File "C:\code\py\sqlalchemy-ingres\create_engine_bug_no_dbname.py", line 3, in <module>
sqlalchemy.create_engine('ingres://')
File "<string>", line 2, in create_engine
File "C:\code\py\sqlalchemy-ingres\py312venv\Lib\site-packages\sqlalchemy\util\deprecations.py", line 281, in warned
return fn(*args, **kwargs) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^
File "C:\code\py\sqlalchemy-ingres\py312venv\Lib\site-packages\sqlalchemy\engine\create.py", line 615, in create_engine
(cargs_tup, cparams) = dialect.create_connect_args(u)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\code\py\sqlalchemy-ingres\lib\sqlalchemy_ingres\pyodbc.py", line 56, in create_connect_args
conn_list.append('Database=' + url.database)
~~~~~~~~~~~~^~~~~~~~~~~~~~
TypeError: can only concatenate str (not "NoneType") to str
It looks like sqlalchemy.create_engine() can be called without a database name, as a quick way to get dialect information (without an actual database connection.
The following fails:
With error: