Skip to content
Advertisement

Tag: database-connection

How to add a cursor() of a db connection to a sqlalchemy.orm session? “sqlalchemy.orm.exc.UnmappedInstanceError: Class ‘builtins.int’ is not mapped”

I am in a Ubuntu 22.04 Docker container with Python 3.10. I use these apt packages: I use the following Python packages: The sessionmaker parameter autoflush is set to True. I want to add a deletion and after that an insertion to a sqlalchemy.orm session so that I commit only when the two commands worked out well. The aim of

How to use DatabaseHook objects with PythonOperator in Airflow without running out of connections?

I’m trying to store my database credentials using Airflow Connections and use them with PythonOperators. I noticed that if I pass the credentials to the PythonOperator then every variable gets logged, including the database password. So I moved to pass the connection object itself to the PythonOperator, per the example below. But the issue I have now is that airflow

Can I connect to mysql using Psycopg2 lib

I have a project in python that connects to a postgreSQL database. That project have a module that connects to other data base. The connection string is on a configuration file. I configure it to use a mysql database like this: One running the module I always get the following error: line 179, in connect connection_factory=connection_factory, async=async) psycopg2.OperationalError: FATAL: password

Advertisement