Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'resource' when revision.apply() tries to get the old resource #81

Open
bdklahn opened this issue Nov 19, 2021 · 0 comments
Open

Comments

@bdklahn
Copy link

bdklahn commented Nov 19, 2021

I'm trying to figure out if this is an issue the the endpoint (maybe no longer having a 'resource' associated), or with this library not waiting long enough for a long response, or . . .. Because a newly-created four-four loaded with this data works. But I wonder if the 'resource' key for the older four-four holds more metadata, which socrata-py is not waiting long enough for the endpoint to retrieve.

Here are the relevant traceback lines.

"""
---> 46 job = revision.apply()
47
48 return revision, job

/venv/lib64/python3.8/site-packages/socrata/resource.py in f(*args, **kwargs)
152 old = getattr(self, og_method_name, self._noop)
153 def f(*args, **kwargs):
--> 154 return old(uri, *args, **kwargs)
155 return f
156

/venv/lib64/python3.8/site-packages/socrata/revisions.py in apply(self, uri, output_schema)
393 })
394
--> 395 result = self._subresource(Job, put(
396 self.path(uri),
397 auth = self.auth,

/venv/lib64/python3.8/site-packages/socrata/resource.py in _subresource(self, klass, res, **kwargs)
115
116 def _subresource(self, klass, res, **kwargs):
--> 117 return klass(self.auth, res, self, **kwargs)
118
119 def _subresources(self, klass, resources):

/venv/lib64/python3.8/site-packages/socrata/resource.py in init(self, auth, response, parent, *args, **kwargs)
76 def init(self, auth, response, parent = None, *args, **kwargs):
77 self.auth = auth
---> 78 self._on_response(response)
79 self.parent = parent
80

/venv/lib64/python3.8/site-packages/socrata/resource.py in _on_response(self, response)
93
94 def _on_response(self, response):
---> 95 self.attributes = response['resource']
96 self.links = response['links']
97 self._define_operations(self.links)

KeyError: 'resource'

"""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant