Adam
12/07/2020, 2:28 PMFailed to set task state with error: HTTPError('413 Client Error: Request Entity Too Large for url: <https://api.prefect.io/graphql>')Adam
12/07/2020, 2:29 PMChris White
Adam
12/07/2020, 4:15 PMChris White
Adam
12/07/2020, 4:17 PMChris White
def size_handler(task, old, new):
    <http://prefect.context.logger.info|prefect.context.logger.info>(f"State {new} has serialized representation: {new.serialize()}")@task(state_handlers=[size_handler])
...
# or
my_task(state_handlers=[size_handler])Chris White
Adam
12/07/2020, 5:08 PMAdam
12/08/2020, 1:06 PMState <Running: "Starting task run."> has serialized representation: {'message': 'Starting task run.', 'context': {'tags': []}, 'cached_inputs': {}, '_result': {'__version__': '0.13.18', 'type': 'NoResultType'}, '__version__': '0.13.18', 'type': 'Running'}log_stdout=Truedef clean_file(filepath: str):
    print(f"Cleaning file {filepath}")
    filename = path.basename(filepath)
    with open(filepath, "r") as fin:
        data = fin.read().splitlines(True)
        for index, value in enumerate(data):
            data[index] = "|".join([filename, value])
    with open(filepath, "w") as fout:
        # skip line 1 (header) and skip last line (footer)
        fout.writelines(data[1 : len(data) - 1])
    return filepathfout.writelinesAdam
12/08/2020, 2:59 PMlog_stdoutAdam
12/08/2020, 3:00 PMflow.run()Chris White
RunningAdam
12/09/2020, 9:31 AMFailed to write log with error: 413 Client Error: Request Entity Too Large for url: <https://api.prefect.io/graphql>No heartbeat detected from the remote task; marking the run as failed.log_stdoutAdam
12/10/2020, 4:59 PMAdam
12/10/2020, 4:59 PMChris White
Adam
12/10/2020, 5:39 PMAdam
12/10/2020, 5:39 PMChris White
