Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jace committed Nov 7, 2023
1 parent 612dd28 commit c57619f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/coaster/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ class WebpackManifest(Mapping):
Substitutions complement the original asset names, which continue to be available.
If a substitute overlaps an existing asset, the original is preserved and a
:warn:`RuntimeWarning` is emitted.
:exc:`RuntimeWarning` is emitted.
WebpackManifest does not hold the asset data. It loads and stores it as
``app.extensions['manifest.json']`` during the :meth:`init_app` call, and therefore
Expand Down
8 changes: 2 additions & 6 deletions src/coaster/sqlalchemy/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,8 @@ def add_primary_relationship(
parent_table_name = cast(str, parent.__tablename__)
child_table_name = cast(str, child.__tablename__)
primary_table_name = parent_table_name + '_' + child_table_name + '_primary'
parent_id_columns = [
c.name for c in sa.inspect(parent).primary_key # type: ignore[union-attr]
]
child_id_columns = [
c.name for c in sa.inspect(child).primary_key # type: ignore[union-attr]
]
parent_id_columns = [c.name for c in sa.inspect(parent).primary_key]
child_id_columns = [c.name for c in sa.inspect(child).primary_key]

primary_table_columns: t.List[sa.Column] = (
[
Expand Down
3 changes: 2 additions & 1 deletion src/coaster/sqlalchemy/roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,8 @@ def __eq__(self, other: t.Any) -> bool:
return super().__eq__(other)

def __ne__(self, other: t.Any) -> bool:
return not self.__eq__(other)
# Don't call __eq__ directly, it may return NotImplemented
return not self == other

def __bool__(self) -> bool:
return bool(self._obj)
Expand Down

0 comments on commit c57619f

Please sign in to comment.