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

Cleanup stale indexes and metadata columns #2335

Draft
wants to merge 27 commits into
base: 2.x
Choose a base branch
from
Draft

Cleanup stale indexes and metadata columns #2335

wants to merge 27 commits into from

Conversation

xispa
Copy link
Member

@xispa xispa commented Jun 12, 2023

Description of the issue/feature this PR addresses

Merge #2334 first

This Pull Request removes indexes and metadata columns that are no longer needed

--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.

}

portal = api.get_portal()
for obj in portal.objectValues():
Copy link
Contributor

Choose a reason for hiding this comment

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

Make it better explicit instead of iterating over all objects in the portal, e.g.:

base_catalog_idxs = ["CreationDate", ]
for cat_id, idxs in indexes_to_remove.items():
    cat = api.get_tool(cat_id)
    if isinstance(cat, BaseCatalog):
        idxs.extend(base_catalog_idxs)
    ...

@ramonski
Copy link
Contributor

This PR is marked as Draft. Are you still on it or can we merge already?

@xispa xispa marked this pull request as ready for review August 16, 2023 09:55
@ramonski
Copy link
Contributor

Would you mind to resolve the conflicts of this PR and check if everything is still valid with the new catalogs?

Copy link
Contributor

@ramonski ramonski left a comment

Choose a reason for hiding this comment

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

Would you mind to remove only those indexes:

  • CreationDate
  • getProvince
  • getDistrict
  • getReceivedBy
  • getSampler

Furthermore, the Upgrade step needs to be changed to 2519.

@@ -143,22 +143,9 @@ def __init__(self, context, request):
"toggle": True}),
("ClientID", {
"title": _("Client ID"),
"index": "getClientID",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you remove this Index? Without this it is no longer possible to sort the columns by client ID.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the heads-up. Restored with 1b6e61d

@xispa xispa added PR: Not Ready ⛔️ Cleanup 🧹 Code cleanup and refactoring labels Oct 19, 2023
@xispa xispa marked this pull request as draft May 16, 2024 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cleanup 🧹 Code cleanup and refactoring PR: Not Ready ⛔️
Development

Successfully merging this pull request may close these issues.

None yet

2 participants