Skip to content

Commit

Permalink
Removing unused parsers
Browse files Browse the repository at this point in the history
  • Loading branch information
jim-sheldon committed Mar 21, 2024
1 parent 082476f commit ee88bd6
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 69 deletions.
23 changes: 21 additions & 2 deletions data-serving/data-service/src/controllers/case.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
CuratorsDocument,
} from '../model/day0-case';
import caseFields from '../model/fields.json';
import { CaseStatus } from '../types/enums';
import { Error, Query } from 'mongoose';
import { ObjectId } from 'mongodb';
import { GeocodeOptions, Geocoder, Resolution } from '../geocoding/geocoder';
Expand Down Expand Up @@ -500,14 +501,21 @@ export class CasesController {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const countriesData: any = {};
// Get total case cardinality
const grandTotalCount = await Day0Case.countDocuments({});
const grandTotalCount = await Day0Case.countDocuments({
caseStatus: { $ne: CaseStatus.OmitError }
});
if (grandTotalCount === 0) {
res.status(200).json({});
return;
}

// Get cardinality of case statuses by country
const countriesStatusCounts = await Day0Case.aggregate([
{
$match: {
caseStatus: { $ne: CaseStatus.OmitError }
}
},
{
$group: {
_id: {
Expand Down Expand Up @@ -558,7 +566,8 @@ export class CasesController {
$exists: true,
$ne: null,
},
},
caseStatus: { $ne: CaseStatus.OmitError }
}
},
{
$group: {
Expand Down Expand Up @@ -625,6 +634,11 @@ export class CasesController {
// Get cardinality of case statuses total
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const totalStatusCount: any = await Day0Case.aggregate([
{
$match: {
caseStatus: { $ne: CaseStatus.OmitError }
}
},
{
$group: {
_id: '$caseStatus',
Expand Down Expand Up @@ -652,6 +666,11 @@ export class CasesController {

// Get cardinality of outcomes total
const totalOutcomeCount = await Day0Case.aggregate([
{
$match: {
caseStatus: { $ne: CaseStatus.OmitError }
}
},
{
$match: {
'events.outcome': {
Expand Down
2 changes: 0 additions & 2 deletions dev/Dockerfile-test
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ WORKDIR /app

COPY ./run_e2e_tests.sh ./
COPY ./setup_localstack.py ./
COPY ./setup_ingestion.py ./
COPY ./parsing.py ./
COPY ./test_e2e.py ./

CMD [ "./run_e2e_tests.sh" ]
2 changes: 1 addition & 1 deletion dev/docker-compose.dev.full.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ services:
environment:
DEBUG: "True"
ENABLE_FAKE_GEOCODER: "True"
DB: "${DISEASE_NAME}"
curator:
command: "npm run dev"
volumes:
Expand Down Expand Up @@ -74,7 +75,6 @@ services:
dockerfile: Dockerfile-test
depends_on:
- mongo
- mock-source-data
- localstack
ports:
- "4444:4444"
Expand Down
6 changes: 0 additions & 6 deletions dev/run_e2e_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ set -eou pipefail

echo "Setting up localstack"
python3 setup_localstack.py
echo "Setting up ingestion environment"
python3 setup_ingestion.py
echo "Waiting for batch jobs"
sleep 10
echo "Running all parser batch jobs"
python3 parsing.py run

echo "Running end-to-end tests"
python3 -m pytest -rs -v .
Expand Down
Loading

0 comments on commit ee88bd6

Please sign in to comment.