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

Make ObjectStoreProvider fallible (return Result rather than Option) #3584

Merged
merged 1 commit into from
Sep 22, 2022

Conversation

tustvold
Copy link
Contributor

@tustvold tustvold commented Sep 22, 2022

Which issue does this PR close?

re #3424

Rationale for this change

#3540 (comment)

What changes are included in this PR?

Makes ObjectStoreProvider::get_by_url fallible and clarifies some docs

Are there any user-facing changes?

@tustvold tustvold added the api change Changes the API exposed to users of the crate label Sep 22, 2022
@github-actions github-actions bot added the core Core DataFusion crate label Sep 22, 2022
@tustvold tustvold force-pushed the fallible-object-store-provider branch from 0687700 to 067a25c Compare September 22, 2022 10:03
@alamb alamb changed the title Make ObjectStoreProvider fallible Make ObjectStoreProvider fallible (return Option rather than None) Sep 22, 2022
@alamb alamb changed the title Make ObjectStoreProvider fallible (return Option rather than None) Make ObjectStoreProvider fallible (return Result rather than Option) Sep 22, 2022
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

cc @yahoNanJing and @thinkharderdev for the next ballista upgrade

@alamb
Copy link
Contributor

alamb commented Sep 22, 2022

Thanks @tustvold

@codecov-commenter
Copy link

Codecov Report

Merging #3584 (067a25c) into master (b54a56f) will decrease coverage by 0.00%.
The diff coverage is 20.00%.

@@            Coverage Diff             @@
##           master    #3584      +/-   ##
==========================================
- Coverage   86.03%   86.02%   -0.01%     
==========================================
  Files         300      300              
  Lines       56253    56250       -3     
==========================================
- Hits        48395    48390       -5     
- Misses       7858     7860       +2     
Impacted Files Coverage Δ
datafusion/core/src/datasource/object_store.rs 85.05% <20.00%> (+0.61%) ⬆️
datafusion/expr/src/logical_plan/plan.rs 77.10% <0.00%> (-0.33%) ⬇️
datafusion/common/src/scalar.rs 85.18% <0.00%> (-0.07%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@tustvold tustvold merged commit be6ad1c into apache:master Sep 22, 2022
@ursabot
Copy link

ursabot commented Sep 22, 2022

Benchmark runs are scheduled for baseline = a080c03 and contender = be6ad1c. be6ad1c is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] ursa-thinkcentre-m75q
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

/// Return the key and object store
fn get_by_url(&self, url: &Url) -> Option<Arc<dyn ObjectStore>>;
/// Return an ObjectStore for the provided url based on its scheme and authority
fn get_by_url(&self, url: &Url) -> Result<Arc<dyn ObjectStore>>;
Copy link
Contributor

@yahoNanJing yahoNanJing Sep 23, 2022

Choose a reason for hiding this comment

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

Better to change it to be

Result<Option<Arc<dyn ObjectStore>>>

@yahoNanJing
Copy link
Contributor

Thanks @alamb for this info. I think better to change the return type to be

Result<Option<Arc<dyn ObjectStore>>>

@alamb
Copy link
Contributor

alamb commented Sep 23, 2022

Follow on PR and discussion for Result<Option> is #3595

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api change Changes the API exposed to users of the crate core Core DataFusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants