def test_map_injective(self): ext_fn = MapLookupExtraction(self.mapping, injective=True) actual = ext_fn.build() expected = { "type": "lookup", "lookup": {"type": "map", "map": self.mapping}, "retainMissingValue": False, "replaceMissingValueWith": None, "injective": True, } assert actual == expected
def test_map_replace_missing(self): ext_fn = MapLookupExtraction(self.mapping, replace_missing_values="replacer") actual = ext_fn.build() expected = { "type": "lookup", "lookup": {"type": "map", "map": self.mapping}, "retainMissingValue": False, "replaceMissingValueWith": "replacer", "injective": False, } assert actual == expected
def test_map_injective(self): ext_fn = MapLookupExtraction(self.mapping, injective=True) actual = ext_fn.build() expected = { "type": "lookup", "lookup": { "type": "map", "map": self.mapping }, "retainMissingValue": False, "replaceMissingValueWith": None, "injective": True, } assert actual == expected
def test_map_injective(self): ext_fn = MapLookupExtraction(self.mapping, injective=True) actual = ext_fn.build() expected = { 'type': 'lookup', 'lookup': { 'type': 'map', 'map': self.mapping }, 'retainMissingValue': False, 'replaceMissingValueWith': None, 'injective': True } assert actual == expected
def test_map_injective(self): ext_fn = MapLookupExtraction(self.mapping, injective=True) actual = ext_fn.build() expected = { 'type': 'lookup', 'lookup': { 'type': 'map', 'map': self.mapping }, 'retainMissingValue': False, 'replaceMissingValueWith': None, 'injective': True } assert actual == expected
def test_map_replace_missing(self): ext_fn = MapLookupExtraction(self.mapping, replace_missing_values="replacer") actual = ext_fn.build() expected = { "type": "lookup", "lookup": { "type": "map", "map": self.mapping }, "retainMissingValue": False, "replaceMissingValueWith": "replacer", "injective": False, } assert actual == expected
def test_map_replace_missing(self): ext_fn = MapLookupExtraction(self.mapping, replace_missing_values='replacer') actual = ext_fn.build() expected = { 'type': 'lookup', 'lookup': { 'type': 'map', 'map': self.mapping }, 'retainMissingValue': False, 'replaceMissingValueWith': 'replacer', 'injective': False } assert actual == expected
def test_map_replace_missing(self): ext_fn = MapLookupExtraction(self.mapping, replace_missing_values='replacer') actual = ext_fn.build() expected = { 'type': 'lookup', 'lookup': { 'type': 'map', 'map': self.mapping }, 'retainMissingValue': False, 'replaceMissingValueWith': 'replacer', 'injective': False } assert actual == expected