Skip to content

Drop QUERY_NAME from tests; node.query() takes namespace+name - #16

Closed
adsharma wants to merge 1 commit into
mainfrom
drop-query-name
Closed

adsharma wants to merge 1 commit into
mainfrom
drop-query-name

Conversation

@adsharma

@adsharma adsharma commented Oct 5, 2026

Copy link
Copy Markdown
Owner

QUERY_NAME has been unnecessary since make_query_type (5eeeacc) defaults the query class name. This removes the last two real uses (tests/mock_user.py):\n\n- Query class names (UserQuery, matching predicate prefixes) now pass explicitly as the second arg to node.query().\n- Table mapping (user, review) travels in the namespace dict instead of falling out of name derivation.\n- Bare Node.query() behavior unchanged (generated name, cached on the node).\n\n51 passed (full suite minus ladybug). No production code touched.

make_query_type already defaults the query name, so the explicit QUERY_NAME attrs on mock nodes were redundant. The two things they actually pinned (query class name for predicate prefixes, table name for SQL) now travel explicitly: MockUser.query({"TABLE": "user"}, "UserQuery"). node.query() forwards both to make_query_type; bare .query() still caches by node.
@adsharma

adsharma commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

Superseded: this content is already on main (e56cfe6 and follow-ups) — main has since moved ahead (version 0.6, sqlmodel safe_rebuild). No unique commits remain on this branch.

@adsharma adsharma closed this Oct 5, 2026
@adsharma
adsharma deleted the drop-query-name branch October 5, 2026 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant