Skip to content

Conversation

ttomasz
Copy link

@ttomasz ttomasz commented May 18, 2025

Which issue does this PR close?

Closes #341.

Rationale for this change

Add config option to Azure client that when listing files will ignore paths that do not match to Path rules i.e. files that would fail Path::parse. Currently with path like foo/bar//baz.txt we get a panic.

What changes are included in this PR?

Are there any user-facing changes?

New boolean config option for Azure client: ignore_unparsable_paths.

Copy link
Contributor

@crepererum crepererum left a comment

Choose a reason for hiding this comment

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

Apart from the notes I've left in-line, I'm wondering if we should even panic or should rather return an error. This would be in line with all kinds of unexpected server answers that we handle so far (e.g. weird status codes, broken bodies, TLS failures). The flag would then toggle between "error returned" and "error ignored" instead of "panic" and "no panic". WDYT?

@ttomasz
Copy link
Author

ttomasz commented Jun 1, 2025

Apart from the notes I've left in-line, I'm wondering if we should even panic or should rather return an error. This would be in line with all kinds of unexpected server answers that we handle so far (e.g. weird status codes, broken bodies, TLS failures). The flag would then toggle between "error returned" and "error ignored" instead of "panic" and "no panic". WDYT?

Thanks for the review.

In general it would probably be better to pass the error for user to handle instead of throwing exception/panicking (or as I mentioned in the linked issue there could be a separate interface to get paths as they come i.e. strings instead of parsing them into Path objects). Then the flag wouldn't even be needed.

But I don't know how that could be implemented without backwards incompatible changes.

@crepererum
Copy link
Contributor

What's the current behavior on object_store? I suppose it returns an error if the path is unparsable, right?

Co-authored-by: Kyle Barron <kylebarron2@gmail.com>
.filter_map(|parsed| match parsed {
Ok(parsed) => Some(parsed),
Err(_) if ignore_unparsable_paths => None,
Err(e) => panic!("cannot parse path: {e}"),
Copy link
Contributor

Choose a reason for hiding this comment

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

I read @kylebarron's 👍 on #376 (comment) as "current behavior is there's an error, NOT a panic". So I think the flag should ignore the error, but even if the flag isn't set, you MUST NOT panic.

Copy link
Member

Choose a reason for hiding this comment

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

Oh sorry I was just agreeing with you that it's a good question 😅. I don't recall what the current behavior is

Copy link
Member

Choose a reason for hiding this comment

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

In #376 (comment) @ttomasz said returning an error might require a breaking change, though now that we've released 0.12.2 we can now merge breaking changes, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

though now that we've released 0.12.2 we can now merge breaking changes, right?

right 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow ignoring checks for empty segments in paths (double slash)

3 participants