500 Error when hitting inline query endpoint


I have an integration with Looker and some of our customers are receiving a 500: Reason: Internal Server Error error when posting to the run_inline_query endpoint for some queries.

Example query that triggers this error:

{'column_limit': '50', 'dynamic_fields': [{'expression': '${events.unique_visitors}-offset(${events.unique_visitors},1)', 'is_table_calculation': True, 'label': 'Change', 'table_calculation': 'change'}], 'fields': ['events.unique_visitors', 'events.event_week'], 'fill_fields': None, 'filter_config': {'events.event_date': "[{'type': 'past', 'values': [{'constant': '2', 'unit': 'c_wk'}, {}], 'id': 0}]"}, 'filter_expression': None, 'filters': {'events.event_date': '2 weeks ago for 2 weeks'}, 'has_table_calculations': True, 'limit': '500', 'model': 'thelook', 'pivots': None, 'query_timezone': 'America/Los_Angeles', 'row_total': None, 'runtime': 9.82661509513855, 'share_url': 'https://demo.looker.com/x/xCCk0hSVUsjhJpGF0KY6XU', 'slug': 'SfDGhPd', 'sorts': ['events.event_week desc'], 'total': None, 'view': 'events', 'vis_config': {'colors': "['#1f78b4', '#a6cee3', '#33a02c', '#b2df8a', '#e31a1c', '#fb9a99', '#ff7f00', '#fdbf6f', '#6a3d9a', '#cab2d6', '#b15928', '#edbc0e']", 'comparison_label': 'Weekly Change', 'comparison_reverse_colors': 'False', 'comparison_type': 'change', 'font_size': 'medium', 'show_comparison': 'True', 'show_comparison_label': 'True', 'show_single_value_title': 'True', 'single_value_title': 'Visitors Past Week', 'text_color': 'black', 'type': 'single_value', 'value_format': ''}, 'visible_ui_sections': 'data,filter,vis,fields'}

The use case is that our users are pulling the queries from dashboard elements they’ve created in looker, modifying them if necessary, and then rerunning just the underlying queries with modifications.

A simpler query that works is:
{'model': 'thelook', 'view': 'data_tool', 'filters': {'users.age': '>10'}, 'limit': '500', 'fields': ['users.city', 'users.state', 'users.email']}

I’m using a generated Python SDK to hit the endpoint, and I suspect that maybe one of the extraneous fields I’m sending in the initial query may be triggering an error, but it should probably be a 4xx error rather than 500.