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

Saved Query partial update of nested array #128

Open
masojus opened this issue May 17, 2017 · 0 comments
Open

Saved Query partial update of nested array #128

masojus opened this issue May 17, 2017 · 0 comments

Comments

@masojus
Copy link
Contributor

masojus commented May 17, 2017

Investigate what happens when trying to do an update of a Saved/Cached Query definition such that an element in a nested array is the target of the update. Filters, Funnel Steps and Group By parameters come to mind.

I suspect that right now this works if your target update is the entire array, and you set an entire new list as Filters or Funnel Steps or Group By params. Right now I think when _deep_update() sees the list as something that's not a Mapping it'll stop there and set the entire list as the new property.

Additionally, you really probably just want to change a single property in a particular element in the list, so maybe only the filter op of the 2nd of 3 filters needs to change from gt to gte so how to express that? If this were a realistic scenario, one would send something like this as the conceptual partial update:

{
  "query": {
    "filters": [
      None,
      {
        "operator": "gte",
      }
      None,
    ]
  }
}

Really, this sort of nested complex update is probably A) not common, B) even less likely to happen in a scenario also involving remote collaborative changes to the same query, which is the source of part of the problem solved by partial updates--to not lose remote changes, and therefore C) better handled by just re-creating the query definition from scratch (which avoids dealing with disallowed properties being sent, like last_modified_date and friends).

Thoughts?

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

No branches or pull requests

1 participant