felipecrv opened a new issue, #39718:
URL: https://github.com/apache/arrow/issues/39718
### Describe the enhancement requested
Only the "*IfExists" functions from the Azure SDK ever set
`response.Value.Deleted` to `false` to indicate that a resource wasn't found
and the request succeeded without deleting anything.
This is the implementation of `DataLakePathClient::DeleteIfExists`:
```cpp
Azure::Response<Models::DeletePathResult>
DataLakePathClient::DeleteIfExists(
const DeletePathOptions& options,
const Azure::Core::Context& context) const
{
try
{
return Delete(options, context);
}
catch (StorageException& e)
{
if (e.ErrorCode == _detail::DataLakeFilesystemNotFound
|| e.ErrorCode == _detail::DataLakePathNotFound)
{
Models::DeletePathResult ret;
ret.Deleted = false;
return Azure::Response<Models::DeletePathResult>(std::move(ret),
std::move(e.RawResponse));
}
throw;
}
}
```
It's better that we use the `Delete()` versions of these functions instead
of `DeleteIfExists` and check the `ErrorCode` ourselves to return an
appropriate `Status` instead of something generic.
### Component(s)
C++
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]