Skip to content

Conversation

@cgiachalis
Copy link
Contributor

The config function tiledb_config_unset was meant to return the modified object of class tiledb_config, an S4 class with slot ptr with external pointer. Instead, it returns the external pointer. This PR fixes the issue by using the internal constructor intended for that purpose.

Added unit tests to check the expected class and that value is unset as intended; in addition polish and fixes the documentation in the same file Config.R.

Ref 42a0c17

Reprex:

library(tiledb)

cfg <- tiledb_config()

# Retrieve param
cfg["sm.group.timestamp_end"]
#> sm.group.timestamp_end 
#> "18446744073709551615"

# Set param
cfg["sm.group.timestamp_end"] <- "1000"

# Check param is set
cfg["sm.group.timestamp_end"]
#> sm.group.timestamp_end 
#>                 "1000"

# Reset param
cfg <- tiledb::tiledb_config_unset(cfg, "sm.group.timestamp_end")

# Check param is reset
cfg["sm.group.timestamp_end"]
#> Error in cfg["sm.group.timestamp_end"]: object of type 'externalptr' is not subsettable

class(cfg)
#> [1] "externalptr"

# Fix (with internal cstor)
cfg <- tiledb:::tiledb_config.from_ptr(cfg)

# Check again
cfg["sm.group.timestamp_end"] # OK
#> sm.group.timestamp_end 
#> "18446744073709551615"

Copy link
Member

@mojaveazure mojaveazure left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks for taking care of this @cgiachalis!!

@mojaveazure mojaveazure merged commit 4cf4aa5 into TileDB-Inc:main Aug 26, 2025
@cgiachalis cgiachalis deleted the cg/fix-config-unset branch August 30, 2025 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants