Skip to content

Commit

Permalink
Merge branch 'hotfix/revert-4281-release/public-20200414'
Browse files Browse the repository at this point in the history
  • Loading branch information
pkfec committed Apr 15, 2020
2 parents f1a9292 + 12f9a2e commit 76b3843
Show file tree
Hide file tree
Showing 114 changed files with 5,226 additions and 8,818 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- restore_cache:
keys:
- v2-fec-api-dependencies-{{ checksum "requirements.txt" }}-{{ checksum "package.json" }}
- v2-fec-api-dependencies-{{ checksum "requirements.txt" }}-{{ checksum "requirements-dev.txt" }}-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v2-fec-api-dependencies-

Expand All @@ -66,13 +66,13 @@ jobs:
command: |
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
pip install -r requirements.txt -r requirements-dev.txt
- save_cache:
paths:
- ./venv
- ./node_modules
key: v2-fec-api-dependencies-{{ checksum "requirements.txt" }}-{{ checksum "package.json" }}
key: v2-fec-api-dependencies-{{ checksum "requirements.txt" }}-{{ checksum "requirements-dev.txt" }}-{{ checksum "package.json" }}

- run:
name: Ensure database is available
Expand Down
12 changes: 0 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,18 +266,6 @@ Running the tests:
pytest
```

Running only the pep8 linting:

```
pytest --linting
```

Running the tests without pep8 linting:

```
pytest --no-linting
```

#### The test data subset
If you add new tables to the data, you'll need to generate a new subset for testing.

Expand Down
12 changes: 0 additions & 12 deletions data/migrations/V0191__drop_ofec_totals_pacs_parties.sql

This file was deleted.

201 changes: 0 additions & 201 deletions data/migrations/V0192__add_pg_date_column_to_presidential_tables.sql

This file was deleted.

2 changes: 1 addition & 1 deletion endpoints_walk.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def check_endpoints(server, api_key):
if r.status_code == 200:
print("{}: ok".format(endp))
else:
print("******{}: not working. Status: {}".format(endp, r.status_code))
print("******{}: not working. Status: {}".format(endp,r.status_code))


if __name__ == "__main__":
Expand Down
14 changes: 5 additions & 9 deletions jdbc_utils.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
import re


def get_jdbc_credentials(dbi_url):
"""Extract username and password from connection string"""
DB_URL_REGEX = re.compile(
r'postgresql://(?P<username>[^:]*):?(?P<password>\S*)@(?P<host_port>\S*)$'
)
DB_URL_REGEX = re.compile(r'postgresql://(?P<username>[^:]*):?(?P<password>\S*)@(?P<host_port>\S*)$')
match = DB_URL_REGEX.match(dbi_url)
if match:
jdbc_url = 'jdbc:postgresql://{}'.format(match.group('host_port'))
jdbc_url = 'jdbc:postgresql://{}'.format(
match.group('host_port'))
username = match.group('username')
password = match.group('password')
return jdbc_url, username, password
return None, None, None


def to_jdbc_url(dbi_url):
"""Reformat PostgreSQL uri to JDBC uri"""
jdbc_url, username, password = get_jdbc_credentials(dbi_url)
Expand Down Expand Up @@ -45,13 +42,12 @@ def remove_credentials(error):
'3D000': 'invalid_catalog_name',
'42000': 'syntax_error_or_access_rule_violation',
'42501': 'insufficient_privilege',
'42601': 'syntax_error',
'42601': 'syntax_error'
}
match = re.search(r'.*(SQL State : )+(?P<error>[a-zA-Z0-9]{0,5})', error)
if match:
error_code = match.group('error')
return 'PostgreSQL error code {}: {}'.format(
error_code, login_related_error_codes.get(error_code, error)
)
error_code, login_related_error_codes.get(error_code, error))
else:
return error
1 change: 1 addition & 0 deletions locustfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
{
"sort_nulls_large": True,
"contributor_name": "tom+lewis",
"contributor_name": "thomas+lewis",
"two_year_transaction_period": 2016,
"min_date": "01%2F01%2F2015",
"max_date": "12%2F31%2F2016",
Expand Down
Loading

0 comments on commit 76b3843

Please sign in to comment.