Skip to content

Commit

Permalink
fix alembic reversion and replace metta.generate_uuid with filename_f…
Browse files Browse the repository at this point in the history
…riendly_hash
  • Loading branch information
tweddielin authored and thcrock committed Apr 12, 2019
1 parent c92bd8b commit d3c3ba9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

# revision identifiers, used by Alembic.
revision = '1b990cbc04e4'
down_revision = '0bca1ba9706e'
down_revision = '50e1f1bc2cac'
branch_labels = None
depends_on = None

Expand Down
12 changes: 6 additions & 6 deletions src/triage/risklist/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from triage.component.results_schema import upgrade_db
from triage.component.architect.cohort_table_generators import CohortTableGenerator, DEFAULT_ACTIVE_STATE
from triage.component.architect.entity_date_table_generators import EntityDateTableGenerator, DEFAULT_ACTIVE_STATE
from triage.component.architect.features import FeatureGenerator
from triage.component.architect.builders import MatrixBuilder
from triage.component.catwalk.predictors import Predictor
from triage.component import metta
from triage.component.catwalk.utils import filename_friendly_hash
from triage.util.conf import dt_from_str

from collections import OrderedDict
Expand Down Expand Up @@ -66,12 +66,12 @@ def generate_risk_list(db_engine, matrix_storage_engine, model_storage_engine, m

# 2. Generate cohort
cohort_table_name = f"production.cohort_{model_info['cohort_config']['name']}"
cohort_table_generator = CohortTableGenerator(
cohort_table_generator = EntityDateTableGenerator(
db_engine=db_engine,
query=model_info['cohort_config']['query'],
cohort_table_name=cohort_table_name
entity_date_table_name=cohort_table_name
)
cohort_table_generator.generate_cohort_table([dt_from_str(as_of_date)])
cohort_table_generator.generate_entity_date_table(as_of_dates=[dt_from_str(as_of_date)])

# 3. Generate feature aggregations
feature_generator = FeatureGenerator(
Expand Down Expand Up @@ -145,7 +145,7 @@ def generate_risk_list(db_engine, matrix_storage_engine, model_storage_engine, m
'feature_start_time': model_info['feature_start_time'],
}

matrix_uuid = metta.generate_uuid(matrix_metadata)
matrix_uuid = filename_friendly_hash(matrix_metadata)

matrix_builder.build_matrix(
as_of_times=[as_of_date],
Expand Down

0 comments on commit d3c3ba9

Please sign in to comment.