diff --git a/libs/core/garf/core/__init__.py b/libs/core/garf/core/__init__.py index 7188b24..ade3d1c 100644 --- a/libs/core/garf/core/__init__.py +++ b/libs/core/garf/core/__init__.py @@ -26,4 +26,4 @@ 'ApiReportFetcher', ] -__version__ = '1.2.1' +__version__ = '1.2.2' diff --git a/libs/core/garf/core/cache.py b/libs/core/garf/core/cache.py index 6f839a0..69da6f9 100644 --- a/libs/core/garf/core/cache.py +++ b/libs/core/garf/core/cache.py @@ -83,7 +83,9 @@ def load( """ args_hash = args.hash if args else '' kwargs_hash = ( - hashlib.md5(json.dumps(kwargs).encode('utf-8'), usedforsecurity=False).hexdigest() + hashlib.md5( + json.dumps(kwargs).encode('utf-8'), usedforsecurity=False + ).hexdigest() if kwargs else '' ) @@ -96,7 +98,9 @@ def load( with open(cached_path, 'r', encoding='utf-8') as f: data = json.load(f) logger.debug('Report is loaded from cache: %s', str(cached_path)) - return report.GarfReport.from_json(json.dumps(data)) + loaded_report = report.GarfReport.from_json(json.dumps(data)) + loaded_report.query_specification = query + return loaded_report raise GarfCacheFileNotFoundError def save( @@ -117,7 +121,9 @@ def save( self.location.mkdir(parents=True, exist_ok=True) args_hash = args.hash if args else '' kwargs_hash = ( - hashlib.md5(json.dumps(kwargs).encode('utf-8'), usedforsecurity=False).hexdigest() + hashlib.md5( + json.dumps(kwargs).encode('utf-8'), usedforsecurity=False + ).hexdigest() if kwargs else '' ) diff --git a/libs/core/garf/core/report.py b/libs/core/garf/core/report.py index 78c2ef8..2ebd217 100644 --- a/libs/core/garf/core/report.py +++ b/libs/core/garf/core/report.py @@ -423,8 +423,8 @@ def __add__(self, other: GarfReport) -> GarfReport: return GarfReport( results=self.results + other.results, column_names=self.column_names, - results_placeholder=self.results_placeholder - and other.results_placeholder, + results_placeholder=self.results_placeholder or other.results_placeholder, + query_specification=self.query_specification or other.query_specification, ) @classmethod