From: François Voron Date: Thu, 23 Nov 2023 15:53:07 +0000 (-0500) Subject: docs: fix type annotation in Self-Referential Many-to-Many Relationsh… X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7157d16e3ba521c119958a727af51790ebdf3f34;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git docs: fix type annotation in Self-Referential Many-to-Many Relationsh… A type annotation was wrong in the [Self-Referential Many-to-Many Relationship](https://docs.sqlalchemy.org/en/20/orm/join_conditions.html#self-referential-many-to-many-relationship) code example. ### Description The type annotation was `right_nodes: Mapped[List["None"]]`. I changed it to `Node` since we refer to the ORM class we're looking at. ### Checklist This pull request is: - [x] A documentation / typographical / small typing error fix - Good to go, no issue or tests are needed - [ ] A short code fix - please include the issue number, and create an issue if none exists, which must include a complete example of the issue. one line code fixes without an issue and demonstration will not be accepted. - Please include: `Fixes: #` in the commit message - please include tests. one line code fixes without tests will not be accepted. - [ ] A new feature implementation - please include the issue number, and create an issue if none exists, which must include a complete example of how the feature would look. - Please include: `Fixes: #` in the commit message - please include tests. **Have a nice day!** Closes: #10686 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10686 Pull-request-sha: 7671898116f1b8850e5d8f3ff0f940450a7c1bf4 Change-Id: Iab1535c3d00747eb8c9e9a17aea50606febedbf9 --- diff --git a/doc/build/orm/join_conditions.rst b/doc/build/orm/join_conditions.rst index ef6d74e667..2e6d2d936b 100644 --- a/doc/build/orm/join_conditions.rst +++ b/doc/build/orm/join_conditions.rst @@ -564,14 +564,14 @@ is when establishing a many-to-many relationship from a class to itself, as show __tablename__ = "node" id: Mapped[int] = mapped_column(primary_key=True) label: Mapped[str] - right_nodes: Mapped[List["None"]] = relationship( + right_nodes: Mapped[List["Node"]] = relationship( "Node", secondary=node_to_node, primaryjoin=id == node_to_node.c.left_node_id, secondaryjoin=id == node_to_node.c.right_node_id, back_populates="left_nodes", ) - left_nodes: Mapped[List["None"]] = relationship( + left_nodes: Mapped[List["Node"]] = relationship( "Node", secondary=node_to_node, primaryjoin=id == node_to_node.c.right_node_id,