Skip to content

Warnings verbosity #500

@joeflack4

Description

@joeflack4

Overview

I noticed recently that sometimes warnings are overly verbose. For example, sometimes for a given type of warning, it prints a full warning for each instance of an offending class or mapping, rather than printing some text about the type of warning and then providing a concise list of all the offending cases.

Current behavior

Example

In my instance, this warning repeated 100's of times, each time with a different mapping object, but the same error message. Here's what it looks like with just 3 entries (the latter 2 are fake / just examples).

WARNING:sssom.parsers:One mapping in the mapping set is not well-formed, and therfore not included in the mapping set ({'mapping_justification': 'semapv:UnspecifiedMatching', 'subject_id': 'Orphanet:3080', 'predicate_id': 'oboInOwl:hasDbXref', 'subject_label': 'Intellectual disability, Wolff type'}). Error: object_id must be supplied
WARNING:sssom.parsers:One mapping in the mapping set is not well-formed, and therfore not included in the mapping set ({'mapping_justification': 'semapv:UnspecifiedMatching', 'subject_id': 'Orphanet:3081', 'predicate_id': 'oboInOwl:hasDbXref', 'subject_label': 'LABEL'}). Error: object_id must be supplied
WARNING:sssom.parsers:One mapping in the mapping set is not well-formed, and therfore not included in the mapping set ({'mapping_justification': 'semapv:UnspecifiedMatching', 'subject_id': 'Orphanet:3082', 'predicate_id': 'oboInOwl:hasDbXref', 'subject_label': 'LABEL'}). Error: object_id must be supplied

Suggested behavior

Example

WARNING:sssom.parsers:Non well-formed mappings detected in mapping set, and therefore were excluded.
Error: object_id must be supplied
Offending mappings:
({'mapping_justification': 'semapv:UnspecifiedMatching', 'subject_id': 'Orphanet:3080', 'predicate_id': 'oboInOwl:hasDbXref', 'subject_label': 'Intellectual disability, Wolff type'}). 
({'mapping_justification': 'semapv:UnspecifiedMatching', 'subject_id': 'Orphanet:3081', 'predicate_id': 'oboInOwl:hasDbXref', 'subject_label': 'LABEL'}). 
({'mapping_justification': 'semapv:UnspecifiedMatching', 'subject_id': 'Orphanet:3082', 'predicate_id': 'oboInOwl:hasDbXref', 'subject_label': 'LABEL'}). 

Additional details

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions