Add blob-based add_elements / add_edges for symmetric dimension blob support#1423
Open
skido-cw wants to merge 1 commit into
Open
Add blob-based add_elements / add_edges for symmetric dimension blob support#1423skido-cw wants to merge 1 commit into
skido-cw wants to merge 1 commit into
Conversation
…b support Previously blob (CSV upload + unbound TI process) was only available for deleting edges, while adding elements and edges was REST-only. This makes the support symmetric and scales bulk dimension builds. - ElementService: extract shared blob plumbing (_build_blob_datasource_process, _run_blob_process) and refactor delete_edges_use_blob onto it. - ElementService: add add_elements_use_blob (HierarchyElementInsert) and add_edges_use_blob (HierarchyElementComponentAdd), dispatched from a new use_blob/remove_blob kwarg on add_elements/add_edges. Both admin-gated. - HierarchyService.update_or_create_hierarchy_from_dataframe now adds elements and edges via blob for admins (use_blob=self.is_admin), matching the existing edge-delete path, so the whole bulk build is blob-based for large sets. - Tests: offline process-builder/dispatch unit tests, plus live tests for the new methods and a bulk hierarchy build with many consolidations. Live-tested end to end against TM1 v11 (11.8) and v12 (PA Engine). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Blob loading (CSV upload + unbound TI process) was previously only available for deleting edges (
delete_edges_use_blob), while adding elements and edges was REST-only. This PR makes the support symmetric and scales bulk dimension builds — which is where blob actually pays off (lots of elements + multiple consolidations).Changes
ElementService_build_blob_datasource_process(the ASCII-datasourceProcessskeleton, incl. v11.blbhandling + UTF-8 prolog) and_run_blob_process(CSV serialize → upload → execute → cleanup). Refactoreddelete_edges_use_blob/_build_unwind_hierarchy_edges_from_blob_processonto them.add_elements_use_blob(TIHierarchyElementInsert) andadd_edges_use_blob(TIHierarchyElementComponentAdd), dispatched from a newuse_blob/remove_blobkwarg onadd_elements/add_edges. Both gated by@require_data_admin/@require_ops_admin, matching the existing delete path.HierarchyServiceupdate_or_create_hierarchy_from_dataframenow adds elements and edges via blob for admins (use_blob=self.is_admin), mirroring the edge-delete calls already there — so a large hierarchy build is blob-based end to end.Behavior / compatibility
use_blobdefaults toFalse, so the default path is the unchanged REST behavior (still returns theResponse). Withuse_blob=Truethe methods returnNone, consistent withdelete_edges_use_blob.Celements), then add the edges.Testing
HierarchyElementInsert/HierarchyElementComponentAdd/...ComponentDeletestatements, UTF-8 prolog, v11.blbsuffixing) and theuse_blobdispatch wiring.add_elements_use_blob/add_edges_use_blobtests (incl. consolidations) and a bulkupdate_or_create_hierarchy_from_dataframebuild with many consolidations..blbpath. The fullfrom_dataframesuite (30 tests) passes on v12.black --check .andruff check .pass.🤖 Generated with Claude Code