diff --git a/db_revisions/env.py b/db_revisions/env.py index 92ef7b1..984b617 100644 --- a/db_revisions/env.py +++ b/db_revisions/env.py @@ -1,4 +1,5 @@ import os +from urllib import parse from dotenv import load_dotenv from logging.config import fileConfig from sqlalchemy import engine_from_config, pool @@ -29,7 +30,7 @@ INST_DB_HOST = os.environ.get("INST_DB_HOST") INST_DB_NAME = os.environ.get("INST_DB_NAME") INST_DB_SCHEMA = os.environ.get("INST_DB_SCHEMA") -INST_CONN = f"postgresql://{INST_DB_USER}:{INST_DB_PWD}@{INST_DB_HOST}/{INST_DB_NAME}" +INST_CONN = f"postgresql://{INST_DB_USER}:{parse.quote(INST_DB_PWD, safe='')}@{INST_DB_HOST}/{INST_DB_NAME}" config.set_main_option("sqlalchemy.url", INST_CONN) # end specific SBL configuration diff --git a/db_revisions/versions/a41281b1e109_seed_sbl_institution_type_table.py b/db_revisions/versions/a41281b1e109_seed_sbl_institution_type_table.py index 2abb309..a6ba23e 100644 --- a/db_revisions/versions/a41281b1e109_seed_sbl_institution_type_table.py +++ b/db_revisions/versions/a41281b1e109_seed_sbl_institution_type_table.py @@ -16,18 +16,18 @@ depends_on: Union[str, Sequence[str], None] = None seed_data = [ - {"id": "1", "name": "Bank or savings association."}, - {"id": "2", "name": "Minority depository institution."}, - {"id": "3", "name": "Credit union."}, - {"id": "4", "name": "Nondepository institution."}, - {"id": "5", "name": "Community development financial institution (CDFI)."}, - {"id": "6", "name": "Other nonprofit financial institution."}, - {"id": "7", "name": "Farm Credit System institution."}, - {"id": "8", "name": "Government lender."}, - {"id": "9", "name": "Commercial finance company."}, - {"id": "10", "name": "Equipment finance company."}, - {"id": "11", "name": "Industrial loan company."}, - {"id": "12", "name": "Online lender."}, + {"id": "1", "name": "Bank or savings association"}, + {"id": "2", "name": "Minority depository institution"}, + {"id": "3", "name": "Credit union"}, + {"id": "4", "name": "Nondepository institution"}, + {"id": "5", "name": "Community development financial institution (CDFI)"}, + {"id": "6", "name": "Other nonprofit financial institution"}, + {"id": "7", "name": "Farm Credit System institution"}, + {"id": "8", "name": "Government lender"}, + {"id": "9", "name": "Commercial finance company"}, + {"id": "10", "name": "Equipment finance company"}, + {"id": "11", "name": "Industrial loan company"}, + {"id": "12", "name": "Online lender"}, {"id": "13", "name": "Other"}, ] diff --git a/db_revisions/versions/f4ff7d1aa6df_seed_hmda_institution_type_table.py b/db_revisions/versions/f4ff7d1aa6df_seed_hmda_institution_type_table.py index c49efad..3338d62 100644 --- a/db_revisions/versions/f4ff7d1aa6df_seed_hmda_institution_type_table.py +++ b/db_revisions/versions/f4ff7d1aa6df_seed_hmda_institution_type_table.py @@ -34,7 +34,7 @@ {"id": "15", "name": "MBS of Savings and Loan Holding Co"}, {"id": "16", "name": "MBS of state chartered Thrift"}, {"id": "17", "name": "MBS of federally chartered thrift (OCC supervised)"}, - {"id": "18", "name": "Affiliate of depository institution. MBS is in the same ownership org as a depository."}, + {"id": "18", "name": "Affiliate of depository institution; MBS is in the same ownership org as a depository"}, ] diff --git a/tests/migrations/test_lookup_tables_data_seed.py b/tests/migrations/test_lookup_tables_data_seed.py index 335c40b..e4e0c90 100644 --- a/tests/migrations/test_lookup_tables_data_seed.py +++ b/tests/migrations/test_lookup_tables_data_seed.py @@ -97,7 +97,7 @@ def test_sbl_institution_type_data_seed(alembic_runner: MigrationContext, alembi sbl_institution_type_rows = conn.execute( text("SELECT id, name from %s where id = :id " % sbl_institution_type_tablename), (dict(id="1")) ).fetchall() - sbl_institution_type_expected = [("1", "Bank or savings association.")] + sbl_institution_type_expected = [("1", "Bank or savings association")] assert sbl_institution_type_rows == sbl_institution_type_expected