Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libs/core/garf/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
'ApiReportFetcher',
]

__version__ = '1.2.1'
__version__ = '1.2.2'
12 changes: 9 additions & 3 deletions libs/core/garf/core/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ''
)
Expand All @@ -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(
Expand All @@ -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 ''
)
Expand Down
4 changes: 2 additions & 2 deletions libs/core/garf/core/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading