Skip to content

Commit

Permalink
fix bench
Browse files Browse the repository at this point in the history
  • Loading branch information
micpst committed Aug 30, 2024
1 parent e473cc4 commit 9e37c82
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions benchmarks/sql/bench/views/structured/superhero.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pylint: disable=missing-docstring, missing-return-doc, missing-param-doc, singleton-comparison, consider-using-in, too-many-ancestors, too-many-public-methods
# pylint: disable=attribute-defined-outside-init, missing-docstring, missing-return-doc, missing-param-doc, singleton-comparison, consider-using-in, too-many-ancestors, too-many-public-methods
# flake8: noqa

from typing import Literal
Expand Down Expand Up @@ -549,6 +549,7 @@ def filter_by_race(self, race: str) -> ColumnElement:

class SuperheroView(
DBInitMixin,
SqlAlchemyBaseView,
SuperheroAggregationMixin,
SuperheroFilterMixin,
SuperheroColourAggregationMixin,
Expand All @@ -560,26 +561,23 @@ class SuperheroView(
PublisherAggregationMixin,
PublisherFilterMixin,
RaceFilterMixin,
SqlAlchemyBaseView,
):
"""
View for querying only superheros data. Contains the superhero id, superhero name, full name, height, weight,
publisher name, gender, race, alignment, eye colour, hair colour, skin colour.
"""

def __init__(self, *args, **kwargs) -> None:
self.eye_colour = aliased(Colour)
self.hair_colour = aliased(Colour)
self.skin_colour = aliased(Colour)
super().__init__(*args, **kwargs)

def get_select(self) -> Select:
"""
Initializes the select object for the view.
Returns:
The select object.
"""
self.eye_colour = aliased(Colour)
self.hair_colour = aliased(Colour)
self.skin_colour = aliased(Colour)

return (
select(
Superhero.id,
Expand Down

0 comments on commit 9e37c82

Please sign in to comment.