Hey guys, I noticed that when the STIGG_BASE_URL is not explicitly set, the Stigg client uses the wrong base URL, which is hardcoded in the file, src/stigg/_client.py. Link
if base_url is None:
base_url = os.environ.get("STIGG_BASE_URL")
if base_url is None:
base_url = f"https://api.example.com"
This is the error I got when I do not explicitly set the STIGG_BASE_URL=https://api.stigg.io in my env vars
uv run python stigg_helper.py
Traceback (most recent call last):
File "/Users/amit/repos/zenml/stigg-stripe-demo/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 101, in map_httpcore_exceptions
yield
File "/Users/amit/repos/zenml/stigg-stripe-demo/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 250, in handle_request
resp = self._pool.handle_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/amit/repos/zenml/stigg-stripe-demo/.venv/lib/python3.12/site-packages/httpcore/_sync/connection_pool.py", line 256, in handle_request
raise exc from None
File "/Users/amit/repos/zenml/stigg-stripe-demo/.venv/lib/python3.12/site-packages/httpcore/_sync/connection_pool.py", line 236, in handle_request
response = connection.handle_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/amit/repos/zenml/stigg-stripe-demo/.venv/lib/python3.12/site-packages/httpcore/_sync/connection.py", line 101, in handle_request
raise exc
File "/Users/amit/repos/zenml/stigg-stripe-demo/.venv/lib/python3.12/site-packages/httpcore/_sync/connection.py", line 78, in handle_request
stream = self._connect(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/amit/repos/zenml/stigg-stripe-demo/.venv/lib/python3.12/site-packages/httpcore/_sync/connection.py", line 124, in _connect
stream = self._network_backend.connect_tcp(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/amit/repos/zenml/stigg-stripe-demo/.venv/lib/python3.12/site-packages/httpcore/_backends/sync.py", line 207, in connect_tcp
with map_exceptions(exc_map):
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/amit/.local/share/uv/python/cpython-3.12.12-macos-aarch64-none/lib/python3.12/contextlib.py", line 158, in __exit__
self.gen.throw(value)
File "/Users/amit/repos/zenml/stigg-stripe-demo/.venv/lib/python3.12/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ConnectError: [Errno 8] nodename nor servname provided, or not known
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/amit/repos/zenml/stigg-stripe-demo/.venv/lib/python3.12/site-packages/stigg/_base_client.py", line 1003, in request
response = self._client.send(
^^^^^^^^^^^^^^^^^^
File "/Users/amit/repos/zenml/stigg-stripe-demo/.venv/lib/python3.12/site-packages/httpx/_client.py", line 914, in send
response = self._send_handling_auth(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/amit/repos/zenml/stigg-stripe-demo/.venv/lib/python3.12/site-packages/httpx/_client.py", line 942, in _send_handling_auth
response = self._send_handling_redirects(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/amit/repos/zenml/stigg-stripe-demo/.venv/lib/python3.12/site-packages/httpx/_client.py", line 979, in _send_handling_redirects
response = self._send_single_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/amit/repos/zenml/stigg-stripe-demo/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1014, in _send_single_request
response = transport.handle_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/amit/repos/zenml/stigg-stripe-demo/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 249, in handle_request
with map_httpcore_exceptions():
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/amit/.local/share/uv/python/cpython-3.12.12-macos-aarch64-none/lib/python3.12/contextlib.py", line 158, in __exit__
self.gen.throw(value)
File "/Users/amit/repos/zenml/stigg-stripe-demo/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 118, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError: [Errno 8] nodename nor servname provided, or not known
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/amit/repos/zenml/stigg-stripe-demo/stigg_helper.py", line 5, in <module>
customer_response = client.v1.customers.retrieve(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/amit/repos/zenml/stigg-stripe-demo/.venv/lib/python3.12/site-packages/stigg/resources/v1/customers/customers.py", line 106, in retrieve
return self._get(
^^^^^^^^^^
File "/Users/amit/repos/zenml/stigg-stripe-demo/.venv/lib/python3.12/site-packages/stigg/_base_client.py", line 1211, in get
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/amit/repos/zenml/stigg-stripe-demo/.venv/lib/python3.12/site-packages/stigg/_base_client.py", line 1035, in request
raise APIConnectionError(request=request) from err
stigg.APIConnectionError: Connection error.
Hey guys, I noticed that when the
STIGG_BASE_URLis not explicitly set, the Stigg client uses the wrong base URL, which is hardcoded in the file,src/stigg/_client.py. LinkThis is the error I got when I do not explicitly set the
STIGG_BASE_URL=https://api.stigg.ioin my env vars