Skip to content

feat(python): throw HTTPExceptions instead of IOException for http errors#6533

Merged
Mytherin merged 26 commits intoduckdb:masterfrom
Mause:feature/http-exception-python
Mar 7, 2023
Merged

feat(python): throw HTTPExceptions instead of IOException for http errors#6533
Mytherin merged 26 commits intoduckdb:masterfrom
Mause:feature/http-exception-python

Conversation

@Mause
Copy link
Contributor

@Mause Mause commented Mar 2, 2023

I've pulled out the NodeJS equivalent, will submit it once #6434 is merged

Feedback on C++ code very welcome!

@Mause Mause requested review from Mytherin and Tishj March 3, 2023 06:51
Copy link
Contributor

@Tishj Tishj left a comment

Choose a reason for hiding this comment

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

Looks like a great change, saving the response + error code is definitely a good idea!

# We only run this test if this env var is set
pytestmark = mark.skipif(
not os.getenv('DUCKDB_PYTHON_TEST_EXTENSION_REQUIRED', False),
reason='httpfs extension not available'
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this already done by require ?
I recently learned you can actually see these reasons when you run pytest with the -rs flags. (hardly documented anywhere for some reason)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I'm not sure why this environment variable exists, happy to remove this check though

@Mause Mause changed the base branch from feature to master March 3, 2023 08:59
@Mytherin Mytherin merged commit bd78568 into duckdb:master Mar 7, 2023
@Mytherin
Copy link
Collaborator

Mytherin commented Mar 7, 2023

Thanks! LGTM

@Mause Mause deleted the feature/http-exception-python branch March 7, 2023 08:13
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