def METHOD_NAME(json_bytes: bytes, target: Path):
    """
    Compress the JSON string to a gzipped file at `target`.
    """
    # gzip will fail to open the file if it's parent directory doesn't exist.
    target = Path(target)
    target.parent.mkdir(exist_ok=True, parents=True)
    with gzip.open(target, "wb") as f:
        f.write(json_bytes)