Skip to content

Commit

Permalink
Warn about invalid dataset primary keys
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Nov 26, 2024
1 parent d4359e4 commit 39bbc85
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/config_generator/data_service_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ def _datasets(self, config, session):
dataset['table_name'] = meta.get('table_name')
dataset['primary_key'] = meta.get('primary_key')

if not dataset['primary_key'] in meta['attributes']:
self.logger.warn("The dataset %s.%s does not appear to have a valid primary key" % (dataset['schema'], dataset['table_name']))

dataset['fields'] = []
for key, attr_meta in meta.get('fields', {}).items():

Expand Down

0 comments on commit 39bbc85

Please sign in to comment.