Skip to content

Commit eaa8df2

Browse files
committed
move bulk upsert data to simple upsert
1 parent 5491395 commit eaa8df2

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

examples/basic_example_v2/basic_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ def run(endpoint, database, path):
303303
with ydb.Driver(
304304
endpoint=endpoint,
305305
database=database,
306-
# credentials=ydb.credentials_from_env_variables()
306+
credentials=ydb.credentials_from_env_variables()
307307
) as driver:
308308
driver.wait(timeout=5, fail_fast=True)
309309

examples/basic_example_v2/basic_example_data.py

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -118,21 +118,6 @@ def get_episodes_data():
118118
Episode(1, 4, 4, "Italian For Beginners", "2010-07-16"),
119119
Episode(1, 4, 5, "Bad Boys", "2010-07-23"),
120120
Episode(1, 4, 6, "Reynholm vs Reynholm", "2010-07-30"),
121-
]
122-
123-
124-
def get_episodes_data_type():
125-
struct_type = ydb.StructType()
126-
struct_type.add_member("series_id", ydb.PrimitiveType.Uint64)
127-
struct_type.add_member("season_id", ydb.PrimitiveType.Uint64)
128-
struct_type.add_member("episode_id", ydb.PrimitiveType.Uint64)
129-
struct_type.add_member("title", ydb.PrimitiveType.Utf8)
130-
struct_type.add_member("air_date", ydb.PrimitiveType.Date)
131-
return ydb.ListType(struct_type)
132-
133-
134-
def get_episodes_data_for_bulk_upsert():
135-
return [
136121
Episode(2, 1, 1, "Minimum Viable Product", "2014-04-06"),
137122
Episode(2, 1, 2, "The Cap Table", "2014-04-13"),
138123
Episode(2, 1, 3, "Articles of Incorporation", "2014-04-20"),
@@ -180,3 +165,13 @@ def get_episodes_data_for_bulk_upsert():
180165
Episode(2, 5, 7, "Initial Coin Offering", "2018-05-06"),
181166
Episode(2, 5, 8, "Fifty-One Percent", "2018-05-13"),
182167
]
168+
169+
170+
def get_episodes_data_type():
171+
struct_type = ydb.StructType()
172+
struct_type.add_member("series_id", ydb.PrimitiveType.Uint64)
173+
struct_type.add_member("season_id", ydb.PrimitiveType.Uint64)
174+
struct_type.add_member("episode_id", ydb.PrimitiveType.Uint64)
175+
struct_type.add_member("title", ydb.PrimitiveType.Utf8)
176+
struct_type.add_member("air_date", ydb.PrimitiveType.Date)
177+
return ydb.ListType(struct_type)

0 commit comments

Comments
 (0)