-
Notifications
You must be signed in to change notification settings - Fork 4
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
Catching HTTP errors #3
Comments
Hey @StephanGeorg thanks for giving this an early try, we really appreciate it! Could you document the change proposal? ie: example query, current Output, desired output (or error, etc) |
I'm using a CREATE OR REPLACE MACRO call_endpoint(a) AS (
SELECT
http_post(
'https://domain.lol/api/endpoint',
headers => MAP {
'accept': 'application/json',
},
params => a
)
AS data); and then apply that to all rows of a table SELECT call_endpoint(MAP {
'countryCode': country,
'street': street,
'houseNumber': house_number,
'postCode': postcode,
'locality': city
}) AS output_data
FROM '/path/to/input.csv'; For some rows, the endpoint returns HTTP status code Invalid Error: HTTP POST error: 404 - Not Found for all results, it should catch errors where the request was unsuccessful and return results where it was successful. Or you wrap the result into an object that contains the HTTP status code and the payload. |
Hello everyone, I love your idea of changing the type of function results (From LogicalType::VARCHAR to LogicalType::JSON()). They could contain all the information returned by the request and the payload |
Maybe returning some attributes from the Response object: |
I have created this PR. Functions return now response data instead directly the body. |
Thanks @ahuarte47 for taking care of this so elegantly! Fantastic PR 🎉 A new version of the HTTP Client extension has been submitted to the community extension repo |
Thanks @lmangani I did not know if you agreed this change, super!!!! |
Great work from both of you. Thank you so much. |
Merged, Updated and Submitted to the registry 👍 |
Closing as completed by the great @ahuarte47 🎉 |
Tested and can confirm: works as expected 🥳 |
Hi @lmangani. Hi @ahuarte47.
First of all, thank you for this extension. Yes, I know, this is in very early stage but I've been dreaming of a feature like this for a long time because it enables and improves a lot of workflows and pipelines.
I'm not sure if you're open to feedback yet, but catching errors like this would be great:
Cheers.
The text was updated successfully, but these errors were encountered: