@@ -73,9 +73,7 @@ class Series(object):
73
73
def __init__ (self , series_id , title , release_date , info , views , uploaded_user_id ):
74
74
self .series_id = series_id
75
75
self .title = title
76
- self .release_date = (
77
- to_days (release_date ) if isinstance (release_date , str ) else release_date
78
- )
76
+ self .release_date = to_days (release_date ) if isinstance (release_date , str ) else release_date
79
77
self .info = info
80
78
self .views = views
81
79
self .uploaded_user_id = uploaded_user_id
@@ -138,17 +136,11 @@ def callee(session):
138
136
ydb .Column ("series_id" , ydb .OptionalType (ydb .PrimitiveType .Uint64 )),
139
137
ydb .Column ("title" , ydb .OptionalType (ydb .PrimitiveType .Utf8 )),
140
138
ydb .Column ("info" , ydb .OptionalType (ydb .PrimitiveType .Utf8 )),
141
- ydb .Column (
142
- "release_date" , ydb .OptionalType (ydb .PrimitiveType .Datetime )
143
- ),
139
+ ydb .Column ("release_date" , ydb .OptionalType (ydb .PrimitiveType .Datetime )),
144
140
ydb .Column ("views" , ydb .OptionalType (ydb .PrimitiveType .Uint64 )),
145
- ydb .Column (
146
- "uploaded_user_id" , ydb .OptionalType (ydb .PrimitiveType .Uint64 )
147
- ),
141
+ ydb .Column ("uploaded_user_id" , ydb .OptionalType (ydb .PrimitiveType .Uint64 )),
148
142
)
149
- .with_indexes (
150
- ydb .TableIndex ("users_index" ).with_index_columns ("uploaded_user_id" )
151
- ),
143
+ .with_indexes (ydb .TableIndex ("users_index" ).with_index_columns ("uploaded_user_id" )),
152
144
)
153
145
154
146
session .create_table (
@@ -188,9 +180,7 @@ def get_series_data():
188
180
),
189
181
Series (5 , "Fifth episode" , "2006-05-01" , "Cercei is not good person." , 5000 , 1 ),
190
182
Series (6 , "Sixth episode" , "2006-06-01" , "Tyrion is not big." , 6000 , 2 ),
191
- Series (
192
- 7 , "Seventh episode" , "2006-07-01" , "Tywin should close the door." , 7000 , 2
193
- ),
183
+ Series (7 , "Seventh episode" , "2006-07-01" , "Tywin should close the door." , 7000 , 2 ),
194
184
Series (
195
185
8 ,
196
186
"Eighth episode" ,
@@ -244,9 +234,7 @@ def callee(session):
244
234
245
235
246
236
def run (endpoint , database , path ):
247
- driver_config = ydb .DriverConfig (
248
- endpoint , database , credentials = ydb .credentials_from_env_variables ()
249
- )
237
+ driver_config = ydb .DriverConfig (endpoint , database , credentials = ydb .credentials_from_env_variables ())
250
238
with ydb .Driver (driver_config ) as driver :
251
239
try :
252
240
driver .wait (timeout = 5 )
0 commit comments