11# -*- coding: utf-8 -*-
2- import os
3-
2+ import posixpath
43import ydb
54import basic_example_data
65
@@ -269,7 +268,7 @@ def callee(session):
269268
270269def describe_table (pool , path , name ):
271270 def callee (session ):
272- result = session .describe_table (os . path .join (path , name ))
271+ result = session .describe_table (posixpath .join (path , name ))
273272 print ("\n > describe table: series" )
274273 for column in result .columns :
275274 print ("column, name:" , column .name , "," , str (column .type .item ).strip ())
@@ -288,7 +287,7 @@ def bulk_upsert(table_client, path):
288287 .add_column ("air_date" , ydb .OptionalType (ydb .PrimitiveType .Uint64 ))
289288 )
290289 rows = basic_example_data .get_episodes_data_for_bulk_upsert ()
291- table_client .bulk_upsert (os . path .join (path , "episodes" ), rows , column_types )
290+ table_client .bulk_upsert (posixpath .join (path , "episodes" ), rows , column_types )
292291
293292
294293def is_directory_exists (driver , path ):
@@ -302,11 +301,11 @@ def ensure_path_exists(driver, database, path):
302301 paths_to_create = list ()
303302 path = path .rstrip ("/" )
304303 while path not in ("" , database ):
305- full_path = os . path .join (database , path )
304+ full_path = posixpath .join (database , path )
306305 if is_directory_exists (driver , full_path ):
307306 break
308307 paths_to_create .append (full_path )
309- path = os . path .dirname (path ).rstrip ("/" )
308+ path = posixpath .dirname (path ).rstrip ("/" )
310309
311310 while len (paths_to_create ) > 0 :
312311 full_path = paths_to_create .pop (- 1 )
@@ -323,7 +322,7 @@ def run(endpoint, database, path):
323322
324323 # absolute path - prefix to the table's names,
325324 # including the database location
326- full_path = os . path .join (database , path )
325+ full_path = posixpath .join (database , path )
327326
328327 create_tables (pool , full_path )
329328
0 commit comments