We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Running the following piece of code results in the exception below.
import mara_db.auto_migration import mara_db.config import mara_db.dbs mara_db.config.databases = lambda: { "mara": mara_db.dbs.PostgreSQLDB( host="localhost", port=32768, user="postgres", database="example_etl_mara" ) } print(mara_db.auto_migration.engine("mara"))
Exception:
<ipython-input-1-016eb66e9ef8> in <module>() 9 } 10 ---> 11 print(mara_db.auto_migration.engine("mara")) ~/.python_envs/test/lib/python3.7/functools.py in wrapper(*args, **kw) 818 819 def wrapper(*args, **kw): --> 820 return dispatch(args[0].__class__)(*args, **kw) 821 822 registry[object] = func ~/.python_envs/test/lib/python3.7/site-packages/mara_db/auto_migration.py in __(alias, **_) 141 @engine.register(str) 142 def __(alias: str, **_): --> 143 return engine(mara_db.dbs.db(alias)) 144 145 ~/.python_envs/test/lib/python3.7/functools.py in wrapper(*args, **kw) 818 819 def wrapper(*args, **kw): --> 820 return dispatch(args[0].__class__)(*args, **kw) 821 822 registry[object] = func ~/.python_envs/test/lib/python3.7/site-packages/mara_db/auto_migration.py in __(db) 152 def __(db: mara_db.dbs.PostgreSQLDB): 153 return sqlalchemy.create_engine( --> 154 f'postgresql+psycopg2://{db.user}{":"+db.password if db.password else ""}@{db.host}{":"+db.port if db.port else "" }/{db.database}') 155 156 TypeError: can only concatenate str (not "int") to str
Passing the port as a string works.
I would have excepted that port is casted to str or that a more informative error is throw at the creation of the PostgreSQLDB object.
str
PostgreSQLDB
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Running the following piece of code results in the exception below.
Exception:
Passing the port as a string works.
I would have excepted that port is casted to
str
or that a more informative error is throw at the creation of thePostgreSQLDB
object.The text was updated successfully, but these errors were encountered: