Skip to content

Commit 820c01e

Browse files
kchertenkodandhlee
authored andcommitted
chore(samples): add comment about out-of-order requests (#347)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/python-retail/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes #<issue_number_goes_here> 🦕
1 parent def22c1 commit 820c01e

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

generated_samples/interactive-tutorials/product/add_fulfillment_places.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ def get_add_fulfillment_request(
4444
add_fulfillment_request.place_ids = [place_id]
4545
add_fulfillment_request.allow_missing = True
4646

47+
# To send an out-of-order request assign the invalid add_time here:
48+
# import datetime
49+
# add_fulfillment_request.add_time = datetime.datetime.now() - datetime.timedelta(days=1)
50+
4751
print("---add fulfillment request---")
4852
print(add_fulfillment_request)
4953

@@ -69,4 +73,3 @@ async def add_places(product_name: str):
6973
create_product(product_id)
7074

7175
asyncio.run(add_places(product_name))
72-
# [END retail_add_fulfillment_places]

generated_samples/interactive-tutorials/product/remove_fulfillment_places.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ def get_remove_fulfillment_request(
3939
remove_fulfillment_request.place_ids = [store_id]
4040
remove_fulfillment_request.allow_missing = True
4141

42+
# To send an out-of-order request assign the invalid remove_time here:
43+
# import datetime
44+
# remove_fulfillment_request.remove_time = datetime.datetime.now() - datetime.timedelta(days=1)
45+
4246
print("---remove fulfillment request---")
4347
print(remove_fulfillment_request)
4448

@@ -64,4 +68,3 @@ async def remove_places(product_name: str):
6468
product = create_product(product_id)
6569

6670
asyncio.run(remove_places(product.name))
67-
# [END retail_remove_fulfillment_places]

generated_samples/interactive-tutorials/product/set_inventory.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ def get_set_inventory_request(product_name: str) -> SetInventoryRequest:
7373
set_inventory_request.allow_missing = True
7474
set_inventory_request.set_mask = set_mask
7575

76+
# To send an out-of-order request assign the invalid set_time here:
77+
# import datetime
78+
# set_inventory_request.set_time = datetime.datetime.now() - datetime.timedelta(days=1)
79+
7680
print("---set inventory request---")
7781
print(set_inventory_request)
7882

@@ -99,4 +103,3 @@ async def set_inventory_and_remove_product(product_name: str):
99103

100104
product = create_product(product_id)
101105
asyncio.run(set_inventory_and_remove_product(product.name))
102-
# [END retail_set_inventory]

0 commit comments

Comments
 (0)