File tree Expand file tree Collapse file tree 4 files changed +21
-19
lines changed
Expand file tree Collapse file tree 4 files changed +21
-19
lines changed Original file line number Diff line number Diff line change 11import attr
2+ from typing import Optional
23
34
45@attr .s
56class Category :
67 table_name = "categories"
78
8- c_project = attr .ib ()
9- c_type = attr .ib ()
10- c_rating = attr .ib ()
11- c_replacement = attr .ib (default = None )
12- c_category = attr .ib (default = None )
13- c_ranking = attr .ib (default = None )
9+ c_project : bytes = attr .ib ()
10+ c_type : bytes = attr .ib ()
11+ c_rating : bytes = attr .ib ()
12+ c_replacement : Optional [ bytes ] = attr .ib (default = None )
13+ c_category : Optional [ bytes ] = attr .ib (default = None )
14+ c_ranking : Optional [ int ] = attr .ib (default = None )
Original file line number Diff line number Diff line change 11import enum
2-
2+ from typing import Optional
33import attr
44
55
@@ -13,8 +13,8 @@ class NsType(enum.Enum):
1313class Namespace :
1414 table_name = "namespacename"
1515
16- domain = attr .ib ()
17- ns_name = attr .ib ()
18- ns_type = attr .ib ()
19- ns_id = attr .ib (default = None )
20- dbname = attr .ib (default = None )
16+ domain : bytes = attr .ib ()
17+ ns_name : bytes = attr .ib ()
18+ ns_type : NsType = attr .ib ()
19+ ns_id : Optional [ int ] = attr .ib (default = None )
20+ dbname : Optional [ bytes ] = attr .ib (default = None )
Original file line number Diff line number Diff line change 55class Release :
66 table_name = "releases"
77
8- rel_article = attr .ib ()
9- rel_0p5_category = attr .ib ()
10- rel_0p5_timestamp = attr .ib ()
8+ rel_article : bytes = attr .ib ()
9+ rel_0p5_category : bytes = attr .ib ()
10+ rel_0p5_timestamp : bytes = attr .ib ()
Original file line number Diff line number Diff line change 11from sqlalchemy import Column
22from sqlalchemy .dialects .mysql import BINARY
3+ from typing import Optional
34
45from wp1 .wp10_db import Base
56
67
78class Review (Base ):
89 __tablename__ = "reviews"
910
10- value = Column ("rev_value" , BINARY (10 ))
11- article = Column ("rev_article" , BINARY (255 ), primary_key = True )
12- timestamp = Column ("rev_timestamp" , BINARY (20 ))
11+ value : Optional [ bytes ] = Column ("rev_value" , BINARY (10 ))
12+ article : bytes = Column ("rev_article" , BINARY (255 ), primary_key = True )
13+ timestamp : Optional [ bytes ] = Column ("rev_timestamp" , BINARY (20 ))
1314
14- def __repr__ (self ):
15+ def __repr__ (self ) -> str :
1516 return "<Review(value=%r, article=%r, timestamp=%r)>" % (
1617 self .value ,
1718 self .article ,
You can’t perform that action at this time.
0 commit comments