Fix the preview deprecation warning

See issue 3919.
Merge pull request #2232 from asmeurer/preview_deprecation

Fix the preview deprecation warning