Skip to content

Conversation

rustyconover
Copy link
Contributor

This method was documented to return the empty string if the key was not found, but in actuality it was calling .at() on the unordered_map which raised an exception. This PR fixes this behavior to return the empty string if the key is not found.

This method was documented to return the empty string if the key was not found, but in actuality it was calling .at() on the unordered_map which raised an exception.  This PR fixes this behavior to return the empty string if the key is not found.
@pdet
Copy link
Contributor

pdet commented Sep 30, 2024

Hi Rusty, thanks for the PR!

This is probably an oversight from making the method const.

Since you are already improving this, maybe we could clean up the HasExtension() method (it does a similar check now unnecessarily), and maybe the GetOption() should be a private method.

@duckdb-draftbot duckdb-draftbot marked this pull request as draft September 30, 2024 12:18
@rustyconover rustyconover marked this pull request as ready for review September 30, 2024 12:18
@rustyconover
Copy link
Contributor Author

Hi @pdet,

I hope you had a great weekend! I just added a commit to remove the unnecessary check in HasExtension().

Regarding GetOption(), I’m using it to read additional metadata from an ArrowSchemaMetadata, so I’d kindly suggest keeping it public rather than making it private.

Best,
Rusty

@pdet
Copy link
Contributor

pdet commented Sep 30, 2024

Hi @pdet,

I hope you had a great weekend! I just added a commit to remove the unnecessary check in HasExtension().

Regarding GetOption(), I’m using it to read additional metadata from an ArrowSchemaMetadata, so I’d kindly suggest keeping it public rather than making it private.

Best, Rusty

Hi Rusty,

I hope you had an excellent week as well!
Thanks for the change! I think it looks great! I get your need to access the method publically!

I think this is good to go, after all the CI runs pass.

@hannes hannes requested a review from pdet October 2, 2024 10:24
@hannes hannes merged commit 8aca433 into duckdb:main Oct 2, 2024
42 checks passed
@hannes
Copy link
Member

hannes commented Oct 2, 2024

thanks!

github-actions bot pushed a commit to duckdb/duckdb-r that referenced this pull request Oct 16, 2024
fix: ArrowSchemaMetadata::GetOption to return empty string instead of raising exception if key is not found. (duckdb/duckdb#14157)
github-actions bot added a commit to duckdb/duckdb-r that referenced this pull request Oct 16, 2024
fix: ArrowSchemaMetadata::GetOption to return empty string instead of raising exception if key is not found. (duckdb/duckdb#14157)

Co-authored-by: krlmlr <krlmlr@users.noreply.github.com>
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.

3 participants