-
Notifications
You must be signed in to change notification settings - Fork 15.5k
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
RepeatedField: unset by index #11425
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Looks like the change is failing in CI. |
@haberman I think it fixed it. Could you please run CI tests again? |
Looks like it is still failing:
|
ad81ac4
to
9ae6b06
Compare
@haberman Thanks for logs. Should be fixed now. Replaced If initial array was WDYT? |
@Leprechaunz we should remain consistent with how PHP treats |
@bshaffer It's easy to do it for PHP. But extension written in C works differently.
Maybe someone more experienced has better ideas? |
@Leprechaunz thank you for the explanation, that makes sense! It's also probably why the original implementation was written like it is (only unsetting the last element). Since this is new behavior, I think the way you've implemented it makes sense (given that it isn't a breaking change and is consistent between the extension and the native implementation). I'm not the maintainer of this library though, so it'll be up to them. Thanks for your work on this! |
@haberman Could you please re-run tests? |
The approach in this PR makes sense to me. Protobuf repeated fields are always dense: there is no way to have gaps or missing indices in the middle. So we definitely don't want a repeated field to use |
@haberman Sorry to bother you, but I updated my branch and re-run tests. Everything works localy. Could you please re-run tests? |
Merge of this PR is blocked because of "Tests / Check for Safety". Is there something I can do about it? Or maintainers will handle it? |
I think you need to rebase this onto our latest head. We have had a bunch of updates to our CI recently. |
Instead of using `array_pop()` to remove last element use `unset()` to remove by index Closes protocolbuffers#11425 COPYBARA_INTEGRATE_REVIEW=protocolbuffers#11425 from Leprechaunz:unset-by-index a47fba5 PiperOrigin-RevId: 508691545
Instead of using
array_pop()
to remove last element useunset()
to remove by index