Only validate dataSource when defined

/to @raymondfeng @bajtos