@@ -168,6 +168,11 @@ def load(
168
168
organisations = set ()
169
169
datasets = set ()
170
170
for endpoint in resource ["endpoints" ]:
171
+ if endpoint not in source .records :
172
+ raise RuntimeError (
173
+ f"Endpoint '{ endpoint } ' not found in source. Check the endpoint.csv and source.csv files."
174
+ )
175
+
171
176
for entry in source .records [endpoint ]:
172
177
organisations .add (entry ["organisation" ])
173
178
datasets = set (
@@ -354,7 +359,7 @@ def load(self, directory=None):
354
359
self .source .load (directory = directory )
355
360
self .endpoint .load (directory = directory )
356
361
357
- regenerate_resouces = False
362
+ regenerate_resources = False
358
363
359
364
# Try to load log store from csv first
360
365
try :
@@ -363,22 +368,22 @@ def load(self, directory=None):
363
368
except FileNotFoundError :
364
369
logging .info ("No log.csv - building from log items" )
365
370
self .load_log_items (directory = directory )
366
- regenerate_resouces = True
371
+ regenerate_resources = True
367
372
368
- # Now try to load resoucres , unless we need to rebuild them anyway
369
- if not regenerate_resouces :
373
+ # Now try to load resources , unless we need to rebuild them anyway
374
+ if not regenerate_resources :
370
375
try :
371
376
self .resource .load_csv (directory = directory )
372
377
logging .info (
373
378
f"Resource loaded from CSV - { len (self .resource .entries )} entries"
374
379
)
375
380
except FileNotFoundError :
376
- logging .info ("No resources.csv - genereating from log.csv" )
377
- regenerate_resouces = True
381
+ logging .info ("No resources.csv - generating from log.csv" )
382
+ regenerate_resources = True
378
383
379
384
# Do we need to regenerate resources?
380
- if regenerate_resouces :
381
- logging .info ("Generating resouces from log.csv" )
385
+ if regenerate_resources :
386
+ logging .info ("Generating resources from log.csv" )
382
387
self .resource .load (log = self .log , source = self .source , directory = directory )
383
388
384
389
# attempts to load in old-resources if the file exists, many use cases won't have any
0 commit comments