@@ -84,7 +84,7 @@ def fill_tables_with_data(pool: ydb.QuerySessionPool, path: str):
8484 )
8585
8686
87- def select_simple (pool : ydb .QuerySessionSync , path ):
87+ def select_simple (pool : ydb .QuerySessionPool , path : str ):
8888 print ("\n Check series table..." )
8989 result_sets = pool .execute_with_retries (
9090 """
@@ -113,7 +113,7 @@ def select_simple(pool: ydb.QuerySessionSync, path):
113113 return first_set
114114
115115
116- def upsert_simple (pool : ydb .QuerySessionPool , path ):
116+ def upsert_simple (pool : ydb .QuerySessionPool , path : str ):
117117 print ("\n Performing UPSERT into episodes..." )
118118
119119 pool .execute_with_retries (
@@ -126,7 +126,7 @@ def upsert_simple(pool: ydb.QuerySessionPool, path):
126126 )
127127
128128
129- def select_with_parameters (pool , path , series_id , season_id , episode_id ):
129+ def select_with_parameters (pool : ydb . QuerySessionPool , path : str , series_id , season_id , episode_id ):
130130 result_sets = pool .execute_with_retries (
131131 """
132132 PRAGMA TablePathPrefix("{}");
@@ -142,7 +142,7 @@ def select_with_parameters(pool, path, series_id, season_id, episode_id):
142142 "$seriesId" : series_id , # could be defined implicit
143143 "$seasonId" : (season_id , ydb .PrimitiveType .Int64 ), # could be defined via tuple
144144 "$episodeId" : ydb .TypedValue (episode_id , ydb .PrimitiveType .Int64 ), # could be defined via special class
145- }
145+ },
146146 )
147147
148148 print ("\n > select_with_parameters:" )
@@ -157,8 +157,8 @@ def select_with_parameters(pool, path, series_id, season_id, episode_id):
157157# In most cases it's better to use transaction control settings in session.transaction
158158# calls instead to avoid additional hops to YDB cluster and allow more efficient
159159# execution of queries.
160- def explicit_transaction_control (pool , path , series_id , season_id , episode_id ):
161- def callee (session ):
160+ def explicit_transaction_control (pool : ydb . QuerySessionPool , path : str , series_id , season_id , episode_id ):
161+ def callee (session : ydb . QuerySessionSync ):
162162 query = """
163163 PRAGMA TablePathPrefix("{}");
164164 UPDATE episodes
@@ -191,12 +191,12 @@ def callee(session):
191191 return pool .retry_operation_sync (callee )
192192
193193
194- def drop_tables (pool , path ):
194+ def drop_tables (pool : ydb . QuerySessionPool , path : str ):
195195 print ("\n Cleaning up existing tables..." )
196196 pool .execute_with_retries (DropTablesQuery .format (path ))
197197
198198
199- def create_tables (pool , path ):
199+ def create_tables (pool : ydb . QuerySessionPool , path : str ):
200200 print ("\n Creating table series..." )
201201 pool .execute_with_retries (
202202 """
@@ -248,7 +248,7 @@ def create_tables(pool, path):
248248 )
249249
250250
251- def is_directory_exists (driver , path ):
251+ def is_directory_exists (driver : ydb . Driver , path : str ):
252252 try :
253253 return driver .scheme_client .describe_path (path ).is_directory ()
254254 except ydb .SchemeError :
0 commit comments