constructs as given, as well as ORM-mapped classes.
"""
- if (args and isinstance(args[0], list)) or kw:
+ if (args and hasattr(args[0], '__iter__')) or kw:
return cls.create_legacy_select(*args, **kw)
else:
return cls._create_future_select(*args)
stmt = select([column("q")])
self.assert_compile(stmt, "SELECT q")
+ def test_select_iterable_argument(self):
+
+ with testing.expect_deprecated_20(
+ r"The legacy calling style of select\(\) is deprecated "
+ "and will be removed in SQLAlchemy 2.0"
+ ):
+ stmt = select(iter([column("q")]))
+ self.assert_compile(stmt, "SELECT q")
+
def test_select_kw_argument(self):
with testing.expect_deprecated_20(