Skip to content

Commit 3a8a84e

Browse files
committed
made minor changes to update_date_submission_range and how it is called in controller.py
1 parent 995b39e commit 3a8a84e

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

data/migrate/Errors-Backfilling.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,4 @@ Error Code,Error Type,Message Template,Notes
125125
408,Warning,New station name added
126126
409,Warning,New contribution added
127127
410,Error,Data file failed to validate
128-
1000,Error,Unassigned error message
128+
1000,Error,Unassigned error message

woudc_data_registry/controller.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565

6666
from woudc_data_registry.generate_metadata import (
6767
update_extents,
68-
update_data_submission_ranges)
68+
update_date_submission_ranges)
6969
from woudc_data_registry.models import Contributor, DataRecord
7070
from woudc_data_registry.report import OperatorReport, RunReport, EmailSummary
7171
from woudc_data_registry.search import SearchIndex
@@ -240,6 +240,7 @@ def ingest(ctx, source, reports_dir, lax, bypass, verbosity):
240240

241241
orchestrate(source, reports_dir, metadata_only=lax, bypass=bypass)
242242
update_extents()
243+
update_date_submission_ranges()
243244

244245

245246
@click.command()
@@ -389,12 +390,11 @@ def gather(ctx, path, verbosity):
389390
def update_date_ranges(cntx, models, verbosity):
390391
""" update the start and end dates of the contributors, instruments,
391392
stations, and deployments table from all data submissions"""
392-
registry = Registry()
393393
if models is not None: # update the specified tables
394394
tables = [model.strip() for model in models.split(',')]
395-
update_data_submission_ranges(registry, tables)
395+
update_date_submission_ranges(tables)
396396
else:
397-
update_data_submission_ranges(registry)
397+
update_date_submission_ranges()
398398

399399

400400
data.add_command(ingest)

woudc_data_registry/generate_metadata.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,13 +521,14 @@ def update_extents():
521521
return True
522522

523523

524-
def update_data_submission_ranges(registry, tables=None):
524+
def update_date_submission_ranges(tables=None):
525525
"""
526526
Update date ranges for each station, instrument, contributor, and
527527
deployment of the data submission
528528
529529
:returns: void
530530
"""
531+
registry = Registry()
531532

532533
[
533534
Contributor, Deployment, Station, DataRecord, Instrument

0 commit comments

Comments
 (0)