SparkContext.version is a useful field. SparkSession should provide something similar.
[Github] Pull Request #14165 (lw-lin)