from shared.base_component import BaseComponent

class BasePublisher(BaseComponent):
    def __init__(self, conf):
        BaseComponent.__init__(self, conf)

    def publish(self, message):
        pass

    def __call__(self, message):
        if self.query.match(message):
            message = self.project.transform(message)
            self.publish(message)

    def close(self):
        pass

from shared.base_component import BaseComponent

class BasePublisher(BaseComponent):
    def __init__(self, conf):
        BaseComponent.__init__(self, conf)

    def publish(self, message):
        pass

    def __call__(self, message):
        if self.query.match(message):
            message = self.project.transform(message)
            if message is not None:
                self.publish(message)

    def close(self):
        pass

Discard None values in projections in publishers
Discard None values in projections in publishers

  from shared.base_component import BaseComponent
  
  class BasePublisher(BaseComponent):
      def __init__(self, conf):
          BaseComponent.__init__(self, conf)
  
      def publish(self, message):
          pass
  
      def __call__(self, message):
          if self.query.match(message):
              message = self.project.transform(message)
+             if message is not None:
-             self.publish(message)
+                 self.publish(message)
  
      def close(self):
          pass
  
Discard None values in projections in publishers
## Code Before:
from shared.base_component import BaseComponent

class BasePublisher(BaseComponent):
    def __init__(self, conf):
        BaseComponent.__init__(self, conf)

    def publish(self, message):
        pass

    def __call__(self, message):
        if self.query.match(message):
            message = self.project.transform(message)
            self.publish(message)

    def close(self):
        pass

## Instruction:
Discard None values in projections in publishers
## Code After:
from shared.base_component import BaseComponent

class BasePublisher(BaseComponent):
    def __init__(self, conf):
        BaseComponent.__init__(self, conf)

    def publish(self, message):
        pass

    def __call__(self, message):
        if self.query.match(message):
            message = self.project.transform(message)
            if message is not None:
                self.publish(message)

    def close(self):
        pass
