-
Notifications
You must be signed in to change notification settings - Fork 90
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
Add report of duplicates resources ids #3247
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Locally, I have 168 resources with duplicated IDs for duplicate inside datasets only
udata/commands/db.py
Outdated
for r in dataset.resources: | ||
# If it's the duplicated resource we're interested in and | ||
# that ID was already added to the new_resources (so we are | ||
# on the second resource), do not add it. | ||
if r.id == id and id in [r.id for r in new_resources]: | ||
continue | ||
|
||
new_resources.append(r) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't we directly add resource1?
for r in dataset.resources: | |
# If it's the duplicated resource we're interested in and | |
# that ID was already added to the new_resources (so we are | |
# on the second resource), do not add it. | |
if r.id == id and id in [r.id for r in new_resources]: | |
continue | |
new_resources.append(r) | |
new_resources.append(resource1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No because we also add back all the dataset original resources. But I simplified a lot the code by using r == resource2
in dd1a108
No description provided.