mirror of
https://github.com/karma-riuk/crab.git
synced 2025-07-05 05:28:13 +02:00
added default parameter to keep or not the "Was
still being processed" item from the backup (to delegate to the caller if he wants it)
This commit is contained in:
@ -40,7 +40,7 @@ class Dataset:
|
|||||||
json.dump(self, f, default=lambda o: o.__dict__, indent=4)
|
json.dump(self, f, default=lambda o: o.__dict__, indent=4)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def from_json(filename: str) -> "Dataset":
|
def from_json(filename: str, keep_still_in_progress: bool = False) -> "Dataset":
|
||||||
with open(filename) as f:
|
with open(filename) as f:
|
||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ class Dataset:
|
|||||||
print(f"Warning: missing commented_file in metadata in entry {metadata_data['repo']}/{metadata_data['pr_number']}")
|
print(f"Warning: missing commented_file in metadata in entry {metadata_data['repo']}/{metadata_data['pr_number']}")
|
||||||
print(metadata_data.keys())
|
print(metadata_data.keys())
|
||||||
metadata = Metadata(**metadata_data)
|
metadata = Metadata(**metadata_data)
|
||||||
if metadata.reason_for_failure == "Was still being processed":
|
if not keep_still_in_progress and metadata.reason_for_failure == "Was still being processed":
|
||||||
continue
|
continue
|
||||||
|
|
||||||
files = {
|
files = {
|
||||||
|
Reference in New Issue
Block a user