Skip to content

Commit 41c4b34

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

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

data/migrate/Errors-Backfilling.csv

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ Error Code,Error Type,Message Template,Notes
7373
249,Warning,#TIMESTAMP table after #{table} is missing\, deriving based on requirements,Reserved for Umkehr data tables
7474
250,Warning,Excess field {field} does not belong in table {table}
7575
251,Warning,Duplicate observations found in #{table} for Date={date},Reserved for Umkehr data tables
76-
252,Error,Trailing commas found in #{table} header
77-
253,Warning,Number of columns in {table} content row does not match with the number of column headers
7876
301,Warning,Failed to parse #{table}.Time {component}: contains invalid characters
7977
302,Warning,Failed to parse #{table}.Date {component}: contains invalid characters
8078
303,Warning,#{table}.Date {component} is not within allowable range [{lower}]-[{upper}],Reserved for year and month components

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)