Closed Btibert3 closed 8 years ago
I had to handle this when I build some ruby results.
players.detect {|p| p.id == (item.player_id || item.subject_id)}
Would it help if I included player_id
and a team_id
(that's the other subject type) in the Feat JSON?
I want to try out an option in jsonlite
that flattens nested data. It might do the trick and keep things simple.
I added those keys for player and team to see if it helps. It's deployed to production now.
-- david
On Dec 11, 2015, at 09:02, Brock Tibert notifications@github.com wrote:
I want to try out an option in jsonlite that flattens nested data. It might do the trick and keep things simple.
— Reply to this email directly or view it on GitHub.
We need to be mindful of nested lists on feats.
This might require that we throw together some utility functions to help avoid this for the end user if the "core" datasets will have further nested lists.
the
do.call
will fail because, I believe, howjsonlite
parses lists into dataframes. Simply, it will put nested lists into a single column in the parsed dataframe.For example,
yields
The problem, I believe, is that the column
subject
has nested data, something thatjsonlite
introduced. Let me dig into the docs, I think I recall seeing aflatten
option.