From 6b6a9f848aa593a3d0b135ca4ca473ee75ed1e75 Mon Sep 17 00:00:00 2001 From: wd-mgreynolds Date: Mon, 23 Oct 2023 11:12:21 -0400 Subject: [PATCH] Remove get_fields, migrated to prism.schema_fixup. --- prism/commands/tables_commands.py | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/prism/commands/tables_commands.py b/prism/commands/tables_commands.py index 20faa3f..3b86cd8 100644 --- a/prism/commands/tables_commands.py +++ b/prism/commands/tables_commands.py @@ -555,29 +555,3 @@ def resolve_schema(p=None, file=None, source_name=None, source_id=None): schema = tables['data'][0] return schema - - -def get_fields(table): - if 'fields' not in table: - logger.error('get_fields: table object does not contain fields attribute.') - return None - - # Remove the Prism audit columns. - fields = [fld for fld in table['fields'] if not fld['name'].startswith('WPA_')] - - # Remove tenant specific values - these are not needed - # if the user wants to update a table definition. - for fld in fields: - if 'fieldId' in fld: - del fld['fieldId'] - - if 'id' in fld: - del fld['id'] - - if 'type' in fld: - if 'descriptor' in fld['type']: - # Convert the descriptor to the shortened Prism type syntax. - fld['type']['id'] = f"Schema_Field_Type={fld['type']['descriptor']}" - del fld['type']['descriptor'] - - return fields