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

change combine_responses derivation? #499

Open
gergness opened this issue Sep 11, 2020 · 0 comments
Open

change combine_responses derivation? #499

gergness opened this issue Sep 11, 2020 · 0 comments

Comments

@gergness
Copy link
Contributor

While debugging a feature in the webapp, discovered that combine_responses works in more places when you give it subvariable urls rather than category_id as rcrunch currently does. I suspect that this is because rcrunch still uses an old API that works in some situations, and it would be beneficial to change to the new API, but I may be misunderstanding something.

Example of combine_responses working inside a make_array call which only works when using variables.

(The other issue it might fix is allowing expressions in the args)

{
    "derivation": {
        "function": "array",
        "args": [
            {
                "function": "make_frame",
                "args": [
                    {
                        "map": {
                            "1": {
                                "function": "combine_responses",
                                "args": [
                                    {
                                        "variable": "https://alpha.crunch.io/api/datasets/db8ed626d77a43669799d1b28eb53d12/variables/2281b47ff65f4b41896d06e2b2220fbe/subvariables/00001/"
                                    },
                                    {
                                        "variable": "https://alpha.crunch.io/api/datasets/db8ed626d77a43669799d1b28eb53d12/variables/2281b47ff65f4b41896d06e2b2220fbe/subvariables/00000/"
                                    }
                                ],
                                "references": {
                                    "name": "Channel 4 + BBC"
                                }
                            },
                            "2": {
                                "variable": "https://alpha.crunch.io/api/datasets/db8ed626d77a43669799d1b28eb53d12/variables/2281b47ff65f4b41896d06e2b2220fbe/subvariables/00000/"
                            },
                            "3": {
                                "variable": "https://alpha.crunch.io/api/datasets/db8ed626d77a43669799d1b28eb53d12/variables/2281b47ff65f4b41896d06e2b2220fbe/subvariables/00001/"
                            },
                            "4": {
                                "variable": "https://alpha.crunch.io/api/datasets/db8ed626d77a43669799d1b28eb53d12/variables/2281b47ff65f4b41896d06e2b2220fbe/subvariables/00002/"
                            }
                        }
                    },
                    {
                        "value": [
                            "1",
                            "2",
                            "3",
                            "4"
                        ]
                    }
                ]
            }
        ]
    },
    "name": "R combine_response in a make_frame (flipped order)",
    "alias": "r_combine_response_in_make_frame_flipped"
}
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

1 participant