Repository navigation
Fix dense [<- writes and support [i, j, k] and selected_ranges() - #896
Open
mojaveazure wants to merge 1 commit into
Open
mojaveazure wants to merge 1 commit into
mojaveazure wants to merge 1 commit into
Conversation
Dense `[<-` silently wrote nothing for one-column right-hand sides, rejected three-column ones as dimension/attribute columns, ignored `selected_ranges()`, and built an INT32-only 2-d subarray from `range(i)` and `range(j)`. Writes now build a typed subarray for any number of dimensions from `[i, j, k]` or `selected_ranges()`, matching `[`. Closes #877 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Fixes the dense
[<-write bugs reported in #877, and makes dense writes work for 3D+ arrays.Bugs fixed
[i, j]selected_ranges()ncol > 1, but its outerifstill matched, so the list case was skipped as well. The value kept the nameV1, the name check failed, and theifhad noelse, so the method returned without writing. A name mismatch is now an error.as.integer(c(range(i), range(j))), set only when bothiandjwere given and there was a single attribute. It was 2D and INT32 only, ignoredselected_ranges(), and widened non-contiguous indices. Dense writes with multiple attributes never set a subarray.New behavior
arr[i, j, k] <- valueon dense arrays, capturingkthe same way[does (nd_index_from_syscall()). A 4th index is an error, not a message as on the read side, because ignoring it would write to the wrong cells. Sparse writes still useiandjonly.selected_ranges(), named or unnamed, for any number of dimensions. Dimensions with no selection span their full domain.libtiledb_subarray_add_range_with_type()), so INT64 and datetime dimensions work.nd_index_from_syscall()no longer evaluatesvaluea second time.Behavior changes (in NEWS and
?"[<-,tiledb_array-method")These are now errors:
selected_points()on a write;Also:
selected_ranges()left on an array object from an earlier read now apply to writes through it.Known limitation
A dimension with no index or selected range spans its full domain, not its current domain. This only matters for dense arrays that have a current domain set.
Testing
New
inst/tinytest/test_densewrite.R(32 tests):[i, j]andselected_ranges();[i, j, k]and[i, , k], and an array value;selected_ranges()on a 4D array;It's a separate file because
test_tiledbarray.Rcallsexit_file()partway through on macOS and r-universe.Full suite: 1790 tests, 1 failure (
test_config_profile.R,rest.token). The same failure occurs onmain(1758 tests, 1 failure). This was run against the R changes loaded into an installed 0.34.0 build, not a fresh compile; CI will cover that.Closes #877
🤖 Generated with Claude Code