Skip to content

Commit

Permalink
[Issue apache#12485][Python Client] cannot use any values that evalua…
Browse files Browse the repository at this point in the history
…tes to False (apache#12489)
  • Loading branch information
tsturzl authored Nov 10, 2021
1 parent 1ea381d commit aa59f75
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pulsar-client-cpp/python/pulsar/schema/definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def python_type(self):
return self.__class__

def validate_type(self, name, val):
if not val and not self._required:
if val is None and not self._required:
return self.default()

if not isinstance(val, self.__class__):
Expand Down Expand Up @@ -219,7 +219,7 @@ def python_type(self):
pass

def validate_type(self, name, val):
if not val and not self._required:
if val is None and not self._required:
return self.default()

if type(val) != self.python_type():
Expand Down Expand Up @@ -350,7 +350,7 @@ def python_type(self):
def validate_type(self, name, val):
t = type(val)

if not val and not self._required:
if val is None and not self._required:
return self.default()

if not (t is str or t.__name__ == 'unicode'):
Expand Down

0 comments on commit aa59f75

Please sign in to comment.