Skip to content

Commit

Permalink
doc: fix function python example code error (apache#10805)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ru7z authored Jun 7, 2021
1 parent 416ee72 commit 10aadcd
Show file tree
Hide file tree
Showing 21 changed files with 42 additions and 0 deletions.
2 changes: 2 additions & 0 deletions site2/docs/functions-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,11 @@ class RoutingFunction(Function):
self.fruits_topic = "persistent://public/default/fruits"
self.vegetables_topic = "persistent://public/default/vegetables"

@staticmethod
def is_fruit(item):
return item in [b"apple", b"orange", b"pear", b"other fruits..."]

@staticmethod
def is_vegetable(item):
return item in [b"carrot", b"lettuce", b"radish", b"other vegetables..."]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ class RoutingFunction(Function):
self.fruits_topic = "persistent://public/default/fruits"
self.vegetables_topic = "persistent://public/default/vegetables"

@staticmethod
def is_fruit(item):
return item in ["apple", "orange", "pear", "other fruits..."]

@staticmethod
def is_vegetable(item):
return item in ["carrot", "lettuce", "radish", "other vegetables..."]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ class RoutingFunction(Function):
self.fruits_topic = "persistent://public/default/fruits"
self.vegetables_topic = "persistent://public/default/vegetables"

@staticmethod
def is_fruit(item):
return item in ["apple", "orange", "pear", "other fruits..."]

@staticmethod
def is_vegetable(item):
return item in ["carrot", "lettuce", "radish", "other vegetables..."]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ class RoutingFunction(Function):
self.fruits_topic = "persistent://public/default/fruits"
self.vegetables_topic = "persistent://public/default/vegetables"

@staticmethod
def is_fruit(item):
return item in ["apple", "orange", "pear", "other fruits..."]

@staticmethod
def is_vegetable(item):
return item in ["carrot", "lettuce", "radish", "other vegetables..."]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ class RoutingFunction(Function):
self.fruits_topic = "persistent://public/default/fruits"
self.vegetables_topic = "persistent://public/default/vegetables"

@staticmethod
def is_fruit(item):
return item in ["apple", "orange", "pear", "other fruits..."]

@staticmethod
def is_vegetable(item):
return item in ["carrot", "lettuce", "radish", "other vegetables..."]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,11 @@ class RoutingFunction(Function):
self.fruits_topic = "persistent://public/default/fruits"
self.vegetables_topic = "persistent://public/default/vegetables"

@staticmethod
def is_fruit(item):
return item in ["apple", "orange", "pear", "other fruits..."]

@staticmethod
def is_vegetable(item):
return item in ["carrot", "lettuce", "radish", "other vegetables..."]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,11 @@ class RoutingFunction(Function):
self.fruits_topic = "persistent://public/default/fruits"
self.vegetables_topic = "persistent://public/default/vegetables"

@staticmethod
def is_fruit(item):
return item in ["apple", "orange", "pear", "other fruits..."]

@staticmethod
def is_vegetable(item):
return item in ["carrot", "lettuce", "radish", "other vegetables..."]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ class RoutingFunction(Function):
self.fruits_topic = "persistent://public/default/fruits"
self.vegetables_topic = "persistent://public/default/vegetables"

@staticmethod
def is_fruit(item):
return item in ["apple", "orange", "pear", "other fruits..."]

@staticmethod
def is_vegetable(item):
return item in ["carrot", "lettuce", "radish", "other vegetables..."]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ class RoutingFunction(Function):
self.fruits_topic = "persistent://public/default/fruits"
self.vegetables_topic = "persistent://public/default/vegetables"

@staticmethod
def is_fruit(item):
return item in ["apple", "orange", "pear", "other fruits..."]

@staticmethod
def is_vegetable(item):
return item in ["carrot", "lettuce", "radish", "other vegetables..."]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ class RoutingFunction(Function):
self.fruits_topic = "persistent://public/default/fruits"
self.vegetables_topic = "persistent://public/default/vegetables"

@staticmethod
def is_fruit(item):
return item in [b"apple", b"orange", b"pear", b"other fruits..."]

@staticmethod
def is_vegetable(item):
return item in [b"carrot", b"lettuce", b"radish", b"other vegetables..."]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ class RoutingFunction(Function):
self.fruits_topic = "persistent://public/default/fruits"
self.vegetables_topic = "persistent://public/default/vegetables"

@staticmethod
def is_fruit(item):
return item in [b"apple", b"orange", b"pear", b"other fruits..."]

@staticmethod
def is_vegetable(item):
return item in [b"carrot", b"lettuce", b"radish", b"other vegetables..."]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ class RoutingFunction(Function):
self.fruits_topic = "persistent://public/default/fruits"
self.vegetables_topic = "persistent://public/default/vegetables"

@staticmethod
def is_fruit(item):
return item in [b"apple", b"orange", b"pear", b"other fruits..."]

@staticmethod
def is_vegetable(item):
return item in [b"carrot", b"lettuce", b"radish", b"other vegetables..."]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ class RoutingFunction(Function):
self.fruits_topic = "persistent://public/default/fruits"
self.vegetables_topic = "persistent://public/default/vegetables"

@staticmethod
def is_fruit(item):
return item in [b"apple", b"orange", b"pear", b"other fruits..."]

@staticmethod
def is_vegetable(item):
return item in [b"carrot", b"lettuce", b"radish", b"other vegetables..."]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ class RoutingFunction(Function):
self.fruits_topic = "persistent://public/default/fruits"
self.vegetables_topic = "persistent://public/default/vegetables"

@staticmethod
def is_fruit(item):
return item in [b"apple", b"orange", b"pear", b"other fruits..."]

@staticmethod
def is_vegetable(item):
return item in [b"carrot", b"lettuce", b"radish", b"other vegetables..."]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ class RoutingFunction(Function):
self.fruits_topic = "persistent://public/default/fruits"
self.vegetables_topic = "persistent://public/default/vegetables"

@staticmethod
def is_fruit(item):
return item in [b"apple", b"orange", b"pear", b"other fruits..."]

@staticmethod
def is_vegetable(item):
return item in [b"carrot", b"lettuce", b"radish", b"other vegetables..."]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ class RoutingFunction(Function):
self.fruits_topic = "persistent://public/default/fruits"
self.vegetables_topic = "persistent://public/default/vegetables"

@staticmethod
def is_fruit(item):
return item in [b"apple", b"orange", b"pear", b"other fruits..."]

@staticmethod
def is_vegetable(item):
return item in [b"carrot", b"lettuce", b"radish", b"other vegetables..."]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ class RoutingFunction(Function):
self.fruits_topic = "persistent://public/default/fruits"
self.vegetables_topic = "persistent://public/default/vegetables"

@staticmethod
def is_fruit(item):
return item in [b"apple", b"orange", b"pear", b"other fruits..."]

@staticmethod
def is_vegetable(item):
return item in [b"carrot", b"lettuce", b"radish", b"other vegetables..."]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ class RoutingFunction(Function):
self.fruits_topic = "persistent://public/default/fruits"
self.vegetables_topic = "persistent://public/default/vegetables"

@staticmethod
def is_fruit(item):
return item in [b"apple", b"orange", b"pear", b"other fruits..."]

@staticmethod
def is_vegetable(item):
return item in [b"carrot", b"lettuce", b"radish", b"other vegetables..."]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ class RoutingFunction(Function):
self.fruits_topic = "persistent://public/default/fruits"
self.vegetables_topic = "persistent://public/default/vegetables"

@staticmethod
def is_fruit(item):
return item in [b"apple", b"orange", b"pear", b"other fruits..."]

@staticmethod
def is_vegetable(item):
return item in [b"carrot", b"lettuce", b"radish", b"other vegetables..."]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ class RoutingFunction(Function):
self.fruits_topic = "persistent://public/default/fruits"
self.vegetables_topic = "persistent://public/default/vegetables"

@staticmethod
def is_fruit(item):
return item in [b"apple", b"orange", b"pear", b"other fruits..."]

@staticmethod
def is_vegetable(item):
return item in [b"carrot", b"lettuce", b"radish", b"other vegetables..."]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ class RoutingFunction(Function):
self.fruits_topic = "persistent://public/default/fruits"
self.vegetables_topic = "persistent://public/default/vegetables"

@staticmethod
def is_fruit(item):
return item in [b"apple", b"orange", b"pear", b"other fruits..."]

@staticmethod
def is_vegetable(item):
return item in [b"carrot", b"lettuce", b"radish", b"other vegetables..."]

Expand Down

0 comments on commit 10aadcd

Please sign in to comment.