Skip to content

GH-39718: [C++][FS][Azure] Remove StatusFromErrorResponse as it's not necessary#39719

Merged
felipecrv merged 3 commits intoapache:mainfrom
felipecrv:simplify_error
Jan 22, 2024
Merged

GH-39718: [C++][FS][Azure] Remove StatusFromErrorResponse as it's not necessary#39719
felipecrv merged 3 commits intoapache:mainfrom
felipecrv:simplify_error

Conversation

@felipecrv
Copy link
Copy Markdown
Contributor

@felipecrv felipecrv commented Jan 20, 2024

Rationale for this change

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.

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.

What changes are included in this PR?

  • Removing StatusFromErrorResponse
  • Comments explaining the error handling decisions
  • Addition of a boolean parameter to DeleteDirOnFileSystem that controls how it fails when the directory being deleted doesn't exist

Are these changes tested?

  • Yes, by the existing tests in azurefs_test.cc.

@felipecrv felipecrv changed the title Simplify error GH-39718: [C++][FS][Azure] Remove StatusFromErrorResponse as it's not necessary Jan 20, 2024
@apache apache deleted a comment from github-actions bot Jan 20, 2024
@felipecrv felipecrv requested a review from kou January 20, 2024 23:36
Copy link
Copy Markdown
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

+1

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting review Awaiting review labels Jan 21, 2024
@felipecrv felipecrv merged commit 4fc2a70 into apache:main Jan 22, 2024
@felipecrv felipecrv removed the awaiting merge Awaiting merge label Jan 22, 2024
@felipecrv felipecrv deleted the simplify_error branch January 22, 2024 20:27
@conbench-apache-arrow
Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit 4fc2a70.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

dgreiss pushed a commit to dgreiss/arrow that referenced this pull request Feb 19, 2024
…'s not necessary (apache#39719)

### Rationale for this change

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. 

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.

### What changes are included in this PR?

 - Removing `StatusFromErrorResponse`
 - Comments explaining the error handling decisions
 - Addition of a boolean parameter to `DeleteDirOnFileSystem` that controls how it fails when the directory being deleted doesn't exist
 
### Are these changes tested?

 - Yes, by the existing tests in `azurefs_test.cc`.
* Closes: apache#39718

Authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
Signed-off-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C++][FS][Azure] Remove StatusFromErrorResponse as it's not necessary

2 participants