quadratichq / quadratic

Quadratic | Spreadsheet with Python, SQL, and AI
https://QuadraticHQ.com
Other
3.04k stars 157 forks source link

Unable to pull Stripe data #2040

Closed sensingturtle closed 3 weeks ago

sensingturtle commented 3 weeks ago

Despite using the same code as mentioned on https://www.quadratichq.com/connections/stripe-api I’m getting this error–

ERROR: AttributeError on line 9: module 'stripe' has no attribute 'log'

This is the code that I’m running–

import micropip
await micropip.install('stripe')

from stripe import StripeClient

client = StripeClient("my_test_key_here")

# List customers
customers = client.customers.list()

# Print the first customer's email
print(customers.data[0].email)

I’ve tried in Safari 18.1 (20619.2.8.11.10) as well as Chrome 130.0.6723.117 and I see the error in both.

I’m using macOS Sequoia 15.1 (24B83)

luke-quadratic commented 3 weeks ago

Seems something is broken compatibility wise between Pyodide and the latest version of the Stripe Python API.

To resolve I rewrote the example in JavaScript. We've got some API request work coming up that hopefully fixes in Python.

Nice find!

Closing but linking to this in our other open issue for API requests #1899

sensingturtle commented 3 weeks ago

@luke-quadratic Can you share the JS code that worked for you?