def execute_query(self, data_source_name_or_id, query):
        try:
            if type(data_source_name_or_id) == int:
                data_source = models.DataSource.get_by_id(data_source_name_or_id)
            else:
                data_source = models.DataSource.get(models.DataSource.name==data_source_name_or_id)
        except models.DataSource.DoesNotExist:
            raise Exception("Wrong data source name/id: %s." % data_source_name_or_id)

        data, error = data_source.query_runner.run_query(query)
        if error is not None:
            raise Exception(error)

        # TODO: allow avoiding the json.dumps/loads in same process
        return json.loads(data)
Callback for security group member update.
dataset/ETHPy150Open getredash/redash/redash/query_runner/python.py/Python.execute_query--crossover with--dataset/ETHPy150Open openstack/neutron/neutron/api/rpc/handlers/securitygroups_rpc.py/SecurityGroupAgentRpcCallbackMixin.security_groups_member_updated