How to use the pandasticsearch.queries.Agg function in pandasticsearch

To help you get started, we’ve selected a few pandasticsearch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github onesuper / pandasticsearch / tests / test_queries.py View on Github external
def test_agg_date_histogram(self):
        agg = Agg()
        agg._result_dict = {
            'took': 3,
            'aggregations': {
                'my_date_histogram': {
                    'buckets': [
                        {
                            'doc_count': 1,
                            'key': 1480392360000,
                            'key_as_string': '2016-11-29T04:06:00.000Z',
                            'f1': {'value': 0.1},
                        },
                        {
                            'doc_count': 1,
                            'key': 1480392420000,
                            'key_as_string': '2016-11-29T04:07:00.000Z',
                            'f1': {'value': 0.2},
github onesuper / pandasticsearch / tests / test_queries.py View on Github external
def test_agg_buckets(self):
        agg = Agg()
        agg._result_dict = {
            'took': 1,
            'aggregations': {
                'agg_key': {
                    'buckets': [
                        {
                            'key': 'a',
                            'f1': {'value': 100},
                            'f2': {'value': 1},
                            "doc_count": 12
                        },
                        {
                            'key': 'b',
                            'f1': {'value': 200},
                            'f2': {'value': 2},
                            "doc_count": 13
github onesuper / pandasticsearch / tests / test_queries.py View on Github external
def test_agg_nested_buckets(self):
        agg = Agg()
        agg._result_dict = {
            'aggregations': {
                'agg_key1': {
                    'buckets': [
                        {
                            'key': 'a',
                            'agg_key2': {
                                'buckets': [
                                    {
                                        'key': 'x',
                                        'f1': {'value': 100},
                                        'f2': {'value': 1},
                                        "doc_count": 934422
                                    },
                                    {
                                        'key': 'y',
github onesuper / pandasticsearch / tests / test_queries.py View on Github external
def test_agg_buckets(self):
        agg = Agg()
        agg._result_dict = {
            'aggregations': {
                'agg_key': {
                    'buckets': [
                        {
                            'key': 'a',
                            'f1': {'value': 100},
                            'f2': {'value': 1},
                            "doc_count": 934422
                        },
                        {
                            'key': 'b',
                            'f1': {'value': 200},
                            'f2': {'value': 2},
                            "doc_count": 934422
                        },
github onesuper / pandasticsearch / tests / test_queries.py View on Github external
def test_agg_nested_buckets(self):
        agg = Agg()
        agg._result_dict = {
            'took': 1,
            'aggregations': {
                'agg_key1': {
                    'buckets': [
                        {
                            'key': 'a',
                            'agg_key2': {
                                'buckets': [
                                    {
                                        'key': 'x',
                                        'f1': {'value': 100},
                                        'f2': {'value': 1},
                                        "doc_count": 11
                                    },
                                    {
github onesuper / pandasticsearch / pandasticsearch / queries.py View on Github external
def from_dict(d):
        agg = Agg()
        agg.explain_result(d)
        return agg
github onesuper / pandasticsearch / pandasticsearch / queries.py View on Github external
def __init__(self):
        super(Agg, self).__init__()
        self._index_names = None
        self._indexes = None