I did a pip install of axiom-py and was trying out the examples for the first time. I am getting the following error
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 369: invalid start byte
Below is the stack trace:
Traceback (most recent call last):
File "/Users/arur/code/axiom/ingest.py", line 14, in
ingest("my-dataset")
File "/Users/arur/code/axiom/ingest.py", line 10, in ingest
res = client.ingest_events(dataset_name, [{"foo": "bar"}])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/axiom/client.py", line 223, in ingest_events
return self.ingest(
^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/axiom/client.py", line 206, in ingest
res = self.session.post(path, data=payload, headers=headers, params=params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/requests/sessions.py", line 637, in post
return self.request("POST", url, data=data, json=json, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/requests_toolbelt/sessions.py", line 76, in request
return super(BaseUrlSession, self).request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/requests/sessions.py", line 710, in send
r = dispatch_hook("response", hooks, r, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/requests/hooks.py", line 30, in dispatch_hook
_hook_data = hook(hook_data, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/axiom/client.py", line 161, in
"response": lambda r, *args, **kwargs: raise_response_error(r)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/axiom/client.py", line 118, in raise_response_error
print("##Response:", dump.decode("UTF-8"))
Code block I am trying to execute is ingest.py example
import axiom
import rfc3339
from datetime import datetime,timedelta
I did a pip install of axiom-py and was trying out the examples for the first time. I am getting the following error
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 369: invalid start byte
Below is the stack trace: Traceback (most recent call last): File "/Users/arur/code/axiom/ingest.py", line 14, in
ingest("my-dataset")
File "/Users/arur/code/axiom/ingest.py", line 10, in ingest
res = client.ingest_events(dataset_name, [{"foo": "bar"}])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/axiom/client.py", line 223, in ingest_events
return self.ingest(
^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/axiom/client.py", line 206, in ingest
res = self.session.post(path, data=payload, headers=headers, params=params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/requests/sessions.py", line 637, in post
return self.request("POST", url, data=data, json=json, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/requests_toolbelt/sessions.py", line 76, in request
return super(BaseUrlSession, self).request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/requests/sessions.py", line 710, in send
r = dispatch_hook("response", hooks, r, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/requests/hooks.py", line 30, in dispatch_hook
_hook_data = hook(hook_data, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/axiom/client.py", line 161, in
"response": lambda r, *args, **kwargs: raise_response_error(r)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/axiom/client.py", line 118, in raise_response_error
print("##Response:", dump.decode("UTF-8"))
Code block I am trying to execute is ingest.py example
import axiom import rfc3339 from datetime import datetime,timedelta
def getAxiomClient(): return axiom.Client('', org_id='')
def ingest(dataset_name): client = getAxiomClient() res = client.ingest_events(dataset_name, [{"foo": "bar"}]) print("Ingested %d events with %d failures".format(res.ingested, res.failed))
if name == "main": ingest("my-dataset")
Can I get some help.