models: fix sqlalchemy warning, add dataset_id in join condition