def METHOD_NAME(dataset_meta: pd.DataFrame, url: str) -> str:
    """Get data url from dataset_meta field or use data sheet if dataset_meta is empty."""
    data_url = dataset_meta.set_index(0)[1].to_dict().get("external_csv")
    if data_url and not pd.isnull(data_url):
        # files on Google Drive need modified link for downloading raw csv
        if "drive.google.com" in data_url:
            data_url = data_url.replace("file/d/", "uc?id=").replace("/view?usp=share_link", "&export=download")
    else:
        # use data sheet
        data_url = f"{url}&gid={SHEET_TO_GID['data']}"
    return data_url