Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dq is not in info #1080

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

pvgenuchten
Copy link
Contributor

@pvgenuchten pvgenuchten commented Feb 10, 2025

Overview

fixes bug on metadata import

Related Issue / Discussion

fixes #923

Additional Information

uses try catch when property is not available (not provided by owslib) instead of hasattr

Contributions and Licensing

(as per https://github.com/geopython/pycsw/blob/master/CONTRIBUTING.rst#contributions-and-licensing)

  • I'd like to contribute [feature X|bugfix Y|docs|something else] to pycsw. I confirm that my contributions to pycsw will be compatible with the pycsw license guidelines at the time of contribution.
  • I have already previously agreed to the pycsw Contributions and Licensing Guidelines

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make exceptions more explicit?

if hasattr(md, 'dataquality'):
    _set(context, recobj, 'pycsw:Degree', ','.join(md.dataquality.conformancedegree))
    _set(context, recobj, 'pycsw:Lineage', md.dataquality.lineage)
    _set(context, recobj, 'pycsw:SpecificationTitle', md.dataquality.specificationtitle)
    try:
        _set(context, recobj, 'pycsw:SpecificationDate', md.dataquality.specificationDate[0])
    except IndexError:
        LOGGER.debug('No specification date')

Copy link
Contributor Author

@pvgenuchten pvgenuchten Mar 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indexerror is not thrown if element does not exist, not sure when it is thrown
replaced it for normal exception, then logging the exception, was that the idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Values of Dataquality sections of metadata are not saved into database
2 participants