Skip to content
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

Update aequitas version #952

Open
silil opened this issue Sep 25, 2024 · 0 comments
Open

Update aequitas version #952

silil opened this issue Sep 25, 2024 · 0 comments
Assignees

Comments

@silil
Copy link
Contributor

silil commented Sep 25, 2024

Aequitas version 1.0.0 requires SQLAlchemy 2 which is a huge change in Triage.

We need to update SQLAlchemy, Pandas, Numpy (which are now part of Aequitas requirements)

Main differences between SQLAlchemy 1.x and 2.x are mentioned here

  • Change how we create an engine using an URL, instead of
db_url = URL(
              'postgres',
              host=dbconfig['db']['host'],
              username=dbconfig['db']['user'],
              database=dbconfig['db']['dbname'],
              password=dbconfig['db']['password'],
              port=dbconfig['db']['port']
          )

now is

db_url = URL.create(
              'postgresql+psycopg2',
              host=dbconfig['db']['host'],
              username=dbconfig['db']['user'],
              database=dbconfig['db']['dbname'],
              password=dbconfig['db']['password'],
              port=dbconfig['db']['port']
          )
  • To execute a SQL statement from the engine, instead of
engine.execute("create table incidents (col1 varchar)")

now is

connection = engine.connect()
connection.execute("create table incidents (col1 varchar)")
@silil silil self-assigned this Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant