Skip to content

Commit 2c25cad

Browse files
remove lru_cache due to unhashable arguments
1 parent f1a3d3f commit 2c25cad

File tree

2 files changed

+13
-17
lines changed

2 files changed

+13
-17
lines changed

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -508,19 +508,6 @@ The `--fields` option is required to use CSV output.
508508
509509
A list of all the fields returned by the API is maintained at [Response Fields](https://docs.ipdata.co/api-reference/response-fields)
510510
511-
## Errors
512-
513-
A list of possible errors is available at [Status Codes](https://docs.ipdata.co/api-reference/status-codes)
514-
515-
516-
## Tests
517-
518-
To run all tests
519-
520-
```shell
521-
pytest
522-
```
523-
524511
## Geofeed tools
525512
526513
Geofeed publishers can use the `ipdata validate` command to validate their geofeeds before submission to ipdata. This will catch most but not all issues that might cause processing your geofeed to fail.
@@ -537,4 +524,17 @@ or
537524
538525
```shell
539526
➜ ipdata validate geofeed.txt
527+
```
528+
529+
## Errors
530+
531+
A list of possible errors is available at [Status Codes](https://docs.ipdata.co/api-reference/status-codes)
532+
533+
534+
## Tests
535+
536+
To run all tests
537+
538+
```shell
539+
pytest
540540
```

src/ipdata/ipdata.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ def __init__(
139139
self._session = requests.Session()
140140
self._session.mount("http", adapter)
141141

142-
@functools.lru_cache(maxsize=100)
143142
def _validate_fields(self, fields):
144143
"""
145144
Validates the fields passed in by the user, first ensuring it's a collection. In prior versions 'fields' was a string, however it now needs to be a collection.
@@ -157,7 +156,6 @@ def _validate_fields(self, fields):
157156
f"The field(s) {diff} are not supported. Only {self.valid_fields} are supported."
158157
)
159158

160-
@functools.lru_cache(maxsize=100)
161159
def _validate_ip_address(self, ip):
162160
"""
163161
Checks that 'ip' is a valid IP Address.
@@ -169,7 +167,6 @@ def _validate_ip_address(self, ip):
169167
if request_ip.is_private or request_ip.is_reserved or request_ip.is_multicast:
170168
raise ValueError(f"{ip} is a reserved IP Address")
171169

172-
@functools.lru_cache(maxsize=100)
173170
def lookup(self, resource="", fields=[]):
174171
"""
175172
Makes a GET request to the IPData API for the specified 'resource' and the given 'fields'.
@@ -219,7 +216,6 @@ def lookup(self, resource="", fields=[]):
219216

220217
return data
221218

222-
@functools.lru_cache(maxsize=100)
223219
def bulk(self, resources, fields=[]):
224220
"""
225221
Lookup up to 100 resources in one request. Makes a POST request wth the resources as a JSON array and the specified fields.

0 commit comments

Comments
 (0)