move sqlcontext old-style-class check in if pyspark check