Skip to content

Commit

Permalink
Agrego mensajes de error en lugares donde se levantan excepciones
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaslavandeira committed Mar 26, 2018
1 parent 2782169 commit 2f98c2d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions series_tiempo_ar_api/libs/indexing/indexer/operations.py
Expand Up @@ -89,7 +89,7 @@ def process_column(col, index):
# Lista de intervalos temporales de pandas EN ORDEN
freqs = constants.PANDAS_FREQS
if orig_freq not in freqs:
raise ValueError
raise ValueError(u'Frecuencia inválida: {}'.format(str(orig_freq)))

for freq in freqs:
# Promedio
Expand Down Expand Up @@ -125,7 +125,10 @@ def index_transform(col, transform_function, index, series_id, freq, name):
if not len(transform_col):
return pd.Series()

handle_missing_values(col, transform_col)
try:
handle_missing_values(col, transform_col)
except ValueError:
raise ValueError(u'Error borrando valores sobrantes durante la indexación')
transform_df = generate_interval_transformations_df(transform_col, freq)
result = transform_df.apply(elastic_index,
axis='columns',
Expand Down
Expand Up @@ -166,7 +166,7 @@ def calculate_dataset_indicators(self, node, data_json):
indexable = Dataset.objects.filter(catalog=catalog, indexable=True).count()
self.task.indicator_set.create(type=Indicator.DATASET_INDEXABLE, value=indexable, node=node)

not_indexable = total - indexable
not_indexable = Dataset.objects.filter(catalog=catalog, indexable=False).count()
self.task.indicator_set.create(type=Indicator.DATASET_NOT_INDEXABLE, value=not_indexable, node=node)

updated = Dataset.objects.filter(catalog=catalog, updated=True).count()
Expand Down

0 comments on commit 2f98c2d

Please sign in to comment.