From b145750490fa89b4f02c81d1b06b56d6d8f43b5e Mon Sep 17 00:00:00 2001 From: Luiz Scheinkman Date: Thu, 12 Sep 2019 10:11:00 -0700 Subject: [PATCH] Update elastic_logger to be compatible with latest pandas --- nupic/research/support/elastic_logger.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nupic/research/support/elastic_logger.py b/nupic/research/support/elastic_logger.py index d02f2dc91..d6743a7f0 100644 --- a/nupic/research/support/elastic_logger.py +++ b/nupic/research/support/elastic_logger.py @@ -26,7 +26,7 @@ from elasticsearch.client.xpack import SqlClient from elasticsearch.helpers import BulkIndexError from pandas import DataFrame -from pandas.io.json.normalize import nested_to_record +from pandas.io.json import json_normalize from ray.tune.logger import Logger @@ -178,7 +178,7 @@ def elastic_dsl(client, dsl, index, **kwargs): data = [] for row in response: # Normalize nested dicts in '_source' such as 'config' or 'git' - source = nested_to_record(row["_source"]) if "_source" in row else {} + source = json_normalize(row["_source"]) if "_source" in row else {} # Squeeze scalar fields returned as arrays in the response by the search API fields = row.get("fields", {})