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

Create a DCAT-AP Switzerland I14Y RDF Harvester #98

Merged
merged 8 commits into from
May 28, 2024

Conversation

kovalch
Copy link
Contributor

@kovalch kovalch commented Feb 29, 2024

… template

Copy link
Contributor

@bellisk bellisk left a comment

Choose a reason for hiding this comment

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

Hey, it looks like you just copied and renamed the file harvesters.py and added a couple of bits of logic to the new harvester class, while leaving the rest of the code just the same. Instead of this, could you make the new class SwissDCATI14YRDFHarvester inherit from SwissDCATRDFHarvester, and then only make the adjustments to the logic that are needed? That would be cleaner and easier to maintain.

Some of the comments I left here might not make total sense, because I wrote them assuming that the new class did inherit from SwissDCATRDFHarvester, before realising that I was wrong and it was just a copy.

ckanext/dcatapchharvest/harvesters_i14y.py Outdated Show resolved Hide resolved
ckanext/dcatapchharvest/harvesters_i14y.py Outdated Show resolved Hide resolved
ckanext/dcatapchharvest/harvesters_i14y.py Outdated Show resolved Hide resolved
ckanext/dcatapchharvest/harvesters_i14y.py Outdated Show resolved Hide resolved

return url, []

def _get_guid(self, dataset_dict, source_url=None): # noqa
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need # noqa here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

to long line, # noqa is pretty often used in this script

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we can adapt style of the harvesters.py separately.
is it fine for you?

Copy link
Contributor

Choose a reason for hiding this comment

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

That line is 56 characters long - # noqa is not needed there because of line length.

It's OK for me to leave the existing code as it is, but please don't introduce overly long lines and other mess into the new code you're adding here. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hehe :) this is a good idea not to bring other mess into the new code.
Will remove # noqa here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm, interesting, when I take it away I get
C901 'SwissDCATRDFHarvester._get_guid' is too complex (16)..

I14Y harvester that adapt the identifier
@kovalch kovalch force-pushed the feat/develop_i14y_harvester branch from de35586 to 9252c82 Compare March 1, 2024 12:37
@kovalch kovalch merged commit 2251728 into master May 28, 2024
4 checks passed
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.

2 participants