-
Notifications
You must be signed in to change notification settings - Fork 115
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 method to delete elements #939
Add method to delete elements #939
Conversation
Currently only delete exists in the element service. This is really slow when iterating over. The Odata v4 rest api does not support deleting multiple elements at once. This implementation uses a workaround suggested by Hubert Heijkers (https://community.ibm.com/community/user/businessanalytics/communities/community-home/digestviewer/viewthread?GroupId=3067&MessageKey=43fd0611-5665-4367-b250-f4278dba6ac6&CommunityKey=8fde0600-e22b-4178-acf5-bf4eda43146b&tab=digestviewer). The hierarchy object is patched instead of trying to delete a collection of entities.
Thanks for the implementation @Kevin-Dekker. The way you perform the delete is compliant with OData and the TM1py Object model, and it makes logical sense. Should we perhaps add an optional |
In TM1 I would definitely suggest DimensionDeleteElements:
https://www.ibm.com/docs/en/planning-analytics/2.0.0?topic=dmtf-dimensiondeleteelements
Op zo 16 jul. 2023 om 10:56 schreef Marius Wirtz ***@***.***>
Thanks for the implementation @Kevin-Dekker
<https://github.com/Kevin-Dekker>.
This will be useful!
The way you perform the delete is compliant with OData and the TM1py
Object model, and it makes logical sense.
However, I fear that if we use an unbound TI process with a few
DimensionElementDelete resp. DimensionElementDeleteDirect statements it
might be much faster on large and very large dimensions.
Should we perhaps add an optional use_ti argument to this function?
—
Reply to this email directly, view it on GitHub
<#939 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEDHULOVUKRKGP3FWPILNVLXQOUDJANCNFSM6AAAAAA2KLLQ2M>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
…------
Best regards / Beste groeten,
Wim Gielis
MS Excel MVP 2011-2014
https://www.wimgielis.com <http://www.wimgielis.be>
|
Thanks @MariusWirtz and @wimgielis, I think we need to consider the difference between deleting elements from a dimension and deleting elements from a hierarchy. The currently suggested function only deletes elements from a specific hierarchy. The functions DimensionElementDelete, DimensionElementDeleteDirect, and DimensionDeleteElements, delete elements from the dimension rather than a specific hierarchy. Perhaps we can default to deleting elements from the dimension when no hierarchy is specified and use the method suggested by @wimgielis through an unbound TI as Marius suggests when use_ti is passed as True? In case use_ti is passed as False and no hierarchy_name is specified, we may need to loop over the hierarchies and use code like in the currently suggested MR to delete the elements from each hierarchy. Or will the deleting from the main hierarchy of leaves hierarchy have this effect? I could not figure this out quickly from this thread https://www.tm1forum.com/viewtopic.php?t=14882. |
Removing N level elements via the Leaves hierarchy will remove it from all hierarchies. |
I think we can merge this and implement the |
* Add method to delete elements Currently only delete exists in the element service. This is really slow when iterating over. The Odata v4 rest api does not support deleting multiple elements at once. This implementation uses a workaround suggested by Hubert Heijkers (https://community.ibm.com/community/user/businessanalytics/communities/community-home/digestviewer/viewthread?GroupId=3067&MessageKey=43fd0611-5665-4367-b250-f4278dba6ac6&CommunityKey=8fde0600-e22b-4178-acf5-bf4eda43146b&tab=digestviewer). The hierarchy object is patched instead of trying to delete a collection of entities. * Asynchronous execute_mdx_dataframe was added * Tests were added to CellService_test.py for execute_mdx_dataframe_async * Update CellService.py Don't try to write if removing non-updateable cells results in an empty set * Delete multiple elements using TI Successor of cubewise-code#939 --------- Co-authored-by: KDekker <kdekker@cubewise.com> Co-authored-by: VVM <vvmits98@gmail.com> Co-authored-by: MariusWirtz <MariusWirtz2@gmail.com>
Currently only a element by element delete method exists in the element service. This is really slow when iterating over.
The Odata v4 rest api does not support deleting multiple elements at once, so this implementation uses a workaround suggested by Hubert Heijkers (https://community.ibm.com/community/user/businessanalytics/communities/community-home/digestviewer/viewthread?GroupId=3067&MessageKey=43fd0611-5665-4367-b250-f4278dba6ac6&CommunityKey=8fde0600-e22b-4178-acf5-bf4eda43146b&tab=digestviewer). The hierarchy object is patched instead of trying to delete a collection of entities.