In `prefect.deployments.Deployment` is this a bug?...
# ask-community
m
In
prefect.deployments.Deployment
is this a bug?
Copy code
async def load_from_yaml(cls, path: str):
        data = yaml.safe_load(await anyio.Path(path).read_bytes())
        # load blocks from server to ensure secret values are properly hydrated
        if data.get("storage"):
            block_doc_name = data["storage"].get("_block_document_name")
            # if no doc name, this block is not stored on the server
            if block_doc_name:
                block_slug = data["storage"]["_block_type_slug"]
                block = await Block.load(f"{block_slug}/{block_doc_name}")
                data["storage"] = block

        if data.get("infrastructure"):
            block_doc_name = data["infrastructure"].get("_block_document_name")
            # if no doc name, this block is not stored on the server
            if block_doc_name:
                block_slug = data["infrastructure"]["_block_type_slug"]
                block = await Block.load(f"{block_slug}/{block_doc_name}")
                data["infrastructure"] = block

            return cls(**data)
It makes no sense to me while we would only want to return a class instance if we specify. infrastructure in the yaml file
s
Hi @Matthew Scanlon, it looks like that to me. Do you mind opening a GitHub issue?
👀 1