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

slice_id not being logged correctly. #3311

Closed
timifasubaa opened this issue Aug 16, 2017 · 2 comments
Closed

slice_id not being logged correctly. #3311

timifasubaa opened this issue Aug 16, 2017 · 2 comments

Comments

@timifasubaa
Copy link
Contributor

timifasubaa commented Aug 16, 2017

Slice_id has an inconsistent value. Very often 0. THis field shows up in another JSON object called form_data.

@john-bodley please help me embellish this issue with whatever I left out.
@mistercrunch

Expected results

The slice_id id correctly displayed.

Actual results

0 is howen

How to reproduce?

Go to a slice and check the logs. the slice_id will not be logged.

@john-bodley
Copy link
Member

john-bodley commented Aug 17, 2017

@mistercrunch we discovered that on a number of occasions the slice_id column in the logs table was 0 whilst viewing slices. We speculate it's non-zero when someone saves a slice or adds it to a new or existing dashboard.

I'm not sure when this regression occurred, i.e., why the slice_id isn't defined in either the request.form, request.args, or kwargs per this logic, but looking at the logs it seems to be logged in the form_data key of request.args, i.e.,

{"form_data": "{\"datasource\":\"219__druid\",\"viz_type\":\"line\",\"slice_id\":9797}"}

We hypothesized that the fix would be,

try:
    slice_id = int(d.get('slice_id') or json.loads(d.get('form_data')).get('slice_id')))
except Exception:
    slice_id = 0

@xrmx
Copy link
Contributor

xrmx commented Aug 17, 2017

Which version is this?

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

3 participants