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

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

Merged
merged 3 commits into from
Jan 22, 2024

Conversation

felipecrv
Copy link
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
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
29 of 32 checks passed
@felipecrv felipecrv removed the awaiting merge Awaiting merge label Jan 22, 2024
@felipecrv felipecrv deleted the simplify_error branch January 22, 2024 20:27
Copy link

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 <[email protected]>
Signed-off-by: Felipe Oliveira Carvalho <[email protected]>
zanmato1984 pushed a commit to zanmato1984/arrow that referenced this pull request Feb 28, 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 <[email protected]>
Signed-off-by: Felipe Oliveira Carvalho <[email protected]>
thisisnic pushed a commit to thisisnic/arrow that referenced this pull request Mar 8, 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 <[email protected]>
Signed-off-by: Felipe Oliveira Carvalho <[email protected]>
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