@@ -84,7 +84,7 @@ def fill_tables_with_data(pool: ydb.QuerySessionPool, path: str):
84
84
)
85
85
86
86
87
- def select_simple (pool : ydb .QuerySessionSync , path ):
87
+ def select_simple (pool : ydb .QuerySessionPool , path : str ):
88
88
print ("\n Check series table..." )
89
89
result_sets = pool .execute_with_retries (
90
90
"""
@@ -113,7 +113,7 @@ def select_simple(pool: ydb.QuerySessionSync, path):
113
113
return first_set
114
114
115
115
116
- def upsert_simple (pool : ydb .QuerySessionPool , path ):
116
+ def upsert_simple (pool : ydb .QuerySessionPool , path : str ):
117
117
print ("\n Performing UPSERT into episodes..." )
118
118
119
119
pool .execute_with_retries (
@@ -126,7 +126,7 @@ def upsert_simple(pool: ydb.QuerySessionPool, path):
126
126
)
127
127
128
128
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 ):
130
130
result_sets = pool .execute_with_retries (
131
131
"""
132
132
PRAGMA TablePathPrefix("{}");
@@ -142,7 +142,7 @@ def select_with_parameters(pool, path, series_id, season_id, episode_id):
142
142
"$seriesId" : series_id , # could be defined implicit
143
143
"$seasonId" : (season_id , ydb .PrimitiveType .Int64 ), # could be defined via tuple
144
144
"$episodeId" : ydb .TypedValue (episode_id , ydb .PrimitiveType .Int64 ), # could be defined via special class
145
- }
145
+ },
146
146
)
147
147
148
148
print ("\n > select_with_parameters:" )
@@ -157,8 +157,8 @@ def select_with_parameters(pool, path, series_id, season_id, episode_id):
157
157
# In most cases it's better to use transaction control settings in session.transaction
158
158
# calls instead to avoid additional hops to YDB cluster and allow more efficient
159
159
# 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 ):
162
162
query = """
163
163
PRAGMA TablePathPrefix("{}");
164
164
UPDATE episodes
@@ -191,12 +191,12 @@ def callee(session):
191
191
return pool .retry_operation_sync (callee )
192
192
193
193
194
- def drop_tables (pool , path ):
194
+ def drop_tables (pool : ydb . QuerySessionPool , path : str ):
195
195
print ("\n Cleaning up existing tables..." )
196
196
pool .execute_with_retries (DropTablesQuery .format (path ))
197
197
198
198
199
- def create_tables (pool , path ):
199
+ def create_tables (pool : ydb . QuerySessionPool , path : str ):
200
200
print ("\n Creating table series..." )
201
201
pool .execute_with_retries (
202
202
"""
@@ -248,7 +248,7 @@ def create_tables(pool, path):
248
248
)
249
249
250
250
251
- def is_directory_exists (driver , path ):
251
+ def is_directory_exists (driver : ydb . Driver , path : str ):
252
252
try :
253
253
return driver .scheme_client .describe_path (path ).is_directory ()
254
254
except ydb .SchemeError :
0 commit comments