Skip to content

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?

Copy link

This Pull Request has been inactive for 90 days. In order to manage maintenance burden, it will be automatically closed in 7 days.

@github-actions github-actions bot added the stale label Sep 21, 2025
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