def METHOD_NAME(
    client,
    resource_group_name,
    factory_name,
    data_flow_name,
    properties,
):
    logger = get_logger()
    data_flow_data = {}
    data_flow_data["properties"] = {}
    # Avoid creating in the update command
    try:
        client.get(resource_group_name, factory_name, data_flow_name)
    except Exception as e:
        raise CLIError(
            f"No data flow with this name `{data_flow_name}` exists - no update performed"
        ) from e
    if "name" in properties.keys():
        raise CLIError(
            "Do not update the name of the data flow via CLI - chance of naming collision"
        )
    if "annotations" in properties.keys():
        data_flow_data["properties"]["annotations"] = properties["annotations"]
    if "description" in properties.keys():
        data_flow_data["properties"]["description"] = properties["description"]
    if "typeProperties" in properties.keys():
        logger.warning(
            "If the definition is not correct here, the resource in ADF may be malformed"
        )
        if "sinks" in properties["typeProperties"].keys():
            data_flow_data["properties"]["typeProperties"]["sinks"] = properties[
                "typeProperties"
            ]["sinks"]
        if "sources" in properties["typeProperties"].keys():
            data_flow_data["properties"]["typeProperties"]["sources"] = properties[
                "typeProperties"
            ]["sources"]
        if "transformations" in properties["typeProperties"].keys():
            data_flow_data["properties"]["typeProperties"][
                "transformations"
            ] = properties["typeProperties"]["transformations"]
        if "scriptLines" in properties["typeProperties"].keys():
            data_flow_data["properties"]["typeProperties"]["scriptLines"] = properties[
                "typeProperties"
            ]["scriptLines"]
    return client.create_or_update(
        resource_group_name=resource_group_name,
        factory_name=factory_name,
        data_flow_name=data_flow_name,
        if_match=None,
        data_flow=data_flow_data,
    )