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

add_category+replace_values - resource.table out of date? #352

Open
jamesrkg opened this issue Feb 28, 2019 · 0 comments
Open

add_category+replace_values - resource.table out of date? #352

jamesrkg opened this issue Feb 28, 2019 · 0 comments
Labels
Milestone

Comments

@jamesrkg
Copy link

add_category already auto-ds._reload_variables() before closing, which is needed, however if we follow this up with replace_values we get a 400 bad request that the added category is not defined, e.g.:

ClientError: (<Response [400]>, 'https://app.crunch.io/api/datasets/909f580538cb46ddb4f3453d574a576e/table/', {u'status': u'400 Bad Request', u'message': u'Error executing command: Category 101 is not defined.'})

I think this is because ds.resource.table is out of date, even though the variables catalog is not:

resp = self.resource.table.post(json.dumps(payload))

Currently the only way to fix this is to refresh the dataset manually.

Perhaps when replace_values is called, the dataset needs to be auto-refreshed before taking any other action? This sounds expensive but would be preferable to an error and having to do that manually anyway.

How to reproduce this error:

  1. Add a category to a variable using ds.add_category()
  2. Replace values into that new category using ds.replace_values()
@jamesrkg jamesrkg added the bug label Feb 28, 2019
@jamesrkg jamesrkg added this to the Wishlist milestone Mar 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant