I have a versioned database in ArcGIS and I am wondering how can I tell arcpy what version to query. The closest I have got to an answer has been building a particular connection file that specifies the version to connect to, or use ChangeVersion_management which only works on layers and views.
I can easily do that in a published map on the web using ArcGIS JS API by setting the version using layer.setGDBVersion(version)