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

Add group member with type #5336

Merged
merged 9 commits into from
Oct 17, 2024
Merged

Add group member with type #5336

merged 9 commits into from
Oct 17, 2024

Conversation

ypatia
Copy link
Member

@ypatia ypatia commented Oct 7, 2024

Add a new tiledb_group_add_member_with_type API to avoid checking for the type of the asset before adding a member to a group for optimization purposes.

[sc-47918]


TYPE: C_API
DESC: Add API to get group member with type

TYPE: CPP_API
DESC: Update add_member API to accept an optional type

@ypatia ypatia marked this pull request as ready for review October 7, 2024 14:04
absolute_group_member_uri =
group_uri_.join_path(group_member_uri.to_string());
}
obj_type = object_type(resources, absolute_group_member_uri);
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this not re-introduce the problem?

Copy link
Member

Choose a reason for hiding this comment

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

Only if the object type is not specified by the user. We can move the item type check later, at the time of persisting the group details (and parallelize it and do it on the REST server for remote groups); I think I've brought this up but don't remember what we decided about it.

Copy link
Member Author

Choose a reason for hiding this comment

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

As Teo said that call is in the else branch which is only hit when a type is not provided.
As for moving the check later this is out of the scope of this PR, @teo-tsirpanis feel free to open a ticket about your suggestions.

Copy link
Member

Choose a reason for hiding this comment

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

Opened SC-57148.

tiledb/sm/cpp_api/group.h Show resolved Hide resolved
tiledb/api/c_api/group/group_api.cc Show resolved Hide resolved
tiledb/api/c_api/group/group_api_external.h Outdated Show resolved Hide resolved
tiledb/api/c_api/group/group_api_external.h Outdated Show resolved Hide resolved
const char* uri,
const uint8_t relative,
const char* name,
tiledb_object_t type) TILEDB_NOEXCEPT;
Copy link
Member

Choose a reason for hiding this comment

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

It would be nice if there was a special TILEDB_AUTODETECT value that could be passed in this parameter. This would allow us to call this function add_member_v2, and entirely supersede the old one.

@ypatia ypatia force-pushed the yt/sc-47918/add_group_member_by_type branch from 7a6d039 to 02e3d3f Compare October 8, 2024 14:01
@ypatia ypatia changed the title Add group member by type Add group member with type Oct 9, 2024
@ypatia ypatia force-pushed the yt/sc-47918/add_group_member_by_type branch from c706cce to 1e7e70e Compare October 9, 2024 10:40
@ypatia ypatia force-pushed the yt/sc-47918/add_group_member_by_type branch from 4d9add2 to 5b3f08f Compare October 16, 2024 12:04
@ypatia ypatia force-pushed the yt/sc-47918/add_group_member_by_type branch from 5b3f08f to 53e5d39 Compare October 16, 2024 12:17
@ypatia ypatia force-pushed the yt/sc-47918/add_group_member_by_type branch from a89b6dc to 3186b6e Compare October 16, 2024 15:13
@ypatia
Copy link
Member Author

ypatia commented Oct 16, 2024

I felt a good citizen in this PR and decided to port relevant UTs to REST CI. After spending too much time debugging issues unrelated to this PR, I decided to go with disabling a few of those test to be able to let this change go in finally since it's an important one.

Relevant tickets opened here:
[sc-57858]
[sc-57867]

@ypatia ypatia requested a review from shaunrd0 October 16, 2024 15:16
Copy link
Contributor

@shaunrd0 shaunrd0 left a comment

Choose a reason for hiding this comment

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

Two small comments but LGTM 👍

There are some windows failures but I think it's just from missing file prefix here?

test/src/unit-cppapi-group.cc Outdated Show resolved Hide resolved

// Set expected
auto uri_format = [&](std::string uri) {
return vfs_test_setup_.is_rest() ? vfs_test_setup_.with_prefix(uri) : uri;
Copy link
Contributor

Choose a reason for hiding this comment

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

Just an idea from looking at CI.. maybe this is flipped around and we want to use with_prefix for the false case?

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed all that with_prefix logic that was confusing and went back to using URIs.

@ypatia ypatia force-pushed the yt/sc-47918/add_group_member_by_type branch from d1df508 to 22b550f Compare October 17, 2024 10:21
@ypatia ypatia merged commit 8dbab75 into dev Oct 17, 2024
63 checks passed
@ypatia ypatia deleted the yt/sc-47918/add_group_member_by_type branch October 17, 2024 11:39
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.

4 participants