fastly / fastly-py

A Fastly API client for Python
https://pypi.org/project/fastly/
MIT License
77 stars 60 forks source link

query() got multiple values for keyword argument 'method' #66

Closed beauhoyt closed 1 year ago

beauhoyt commented 4 years ago

I noticed when trying to create a Healthcheck the method property clashes with the parameter in query().

payload = {
    "service_id": newService.attrs["id"],
    "version": 1,
    "name": TEST_NAME,
    "host": REQ_HOST,
    "method": "GET",
    "path": TEST_PATH,
    "expected_response": 200,
    "check_interval": 60000,
    "initial": 1,
    "threshold": 1,
    "timeout": 5000,
    "window": 2,
}
newHealthcheck = fastly.models.Healthcheck.create(api.conn, data=payload)
Traceback (most recent call last):
  File "./python/main.py", line 54, in <module>
    newHealthcheck = fastly.models.Healthcheck.create(api.conn, data=payload)
  File "/usr/local/lib/python2.7/site-packages/fastly/models.py", line 79, in create
    instance.save()
  File "/usr/local/lib/python2.7/site-packages/fastly/models.py", line 44, in save
    resp, data = self._collection_query('POST', body=params_str)
  File "/usr/local/lib/python2.7/site-packages/fastly/models.py", line 29, in _collection_query
    return self.__class__.query(self.conn, self.COLLECTION_PATTERN, method, suffix, body, **self.attrs)
TypeError: query() got multiple values for keyword argument 'method'
annawinkler commented 4 years ago

Thanks @beauhoyt for submitting this issue! We'll take a look.

Integralist commented 1 year ago

Closing this issue now we've published v1.0.0 https://pypi.org/project/fastly/