answered 10 years ago
Just a command to convert to polynomial fraction is needed additionally:
sage: g1=1+ (s^2) ; g2=g1.subs(s= 1/(z-1) ) ; g2.expand().fraction(QQ) (z^2 - 2*z + 2)/(z^2 - 2*z + 1)