MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_with_only_columns

Method test_with_only_columns

test/orm/test_query.py:786–796  ·  view source on GitHub ↗

test #8001

(self, assert_row_keys)

Source from the content-addressed store, hash-verified

784 assert_row_keys(stmt, expected, coreorm_exec)
785
786 def test_with_only_columns(self, assert_row_keys):
787 """test #8001"""
788
789 User, Address = self.classes("User", "Address")
790
791 stmt = select(User.id, Address.email_address).join_from(User, Address)
792 stmt = stmt.with_only_columns(
793 stmt.selected_columns.id, stmt.selected_columns.email_address
794 )
795
796 assert_row_keys(stmt, ["id", "email_address"], "orm")
797
798 def test_explicit_cols_legacy(self):
799 User = self.classes.User

Callers

nothing calls this directly

Calls 3

selectFunction · 0.90
join_fromMethod · 0.80
with_only_columnsMethod · 0.80

Tested by

no test coverage detected