Skip to content

Commit

Permalink
Reverted map fix and ensure DynamicMap keys are validated
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Aug 31, 2017
1 parent ee5fe62 commit 8f3fcdd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 1 addition & 5 deletions holoviews/core/dimension.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,11 +639,7 @@ def map(self, map_fn, specs=None, clone=True):
for k, v in self.items():
new_val = v.map(map_fn, specs, clone)
if new_val is not None:
# Ensure key validation doesn't cause errors
try:
deep_mapped[k] = new_val
except KeyError:
pass
deep_mapped[k] = new_val
if applies: deep_mapped = map_fn(deep_mapped)
return deep_mapped
else:
Expand Down
4 changes: 3 additions & 1 deletion holoviews/core/spaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,8 @@ def __call__(self, *args, **kwargs):

try:
ret = self.callable(*args, **kwargs)
except KeyError:
raise
except:
posstr = ', '.join(['%r' % el for el in self.args]) if self.args else ''
kwstr = ', '.join('%s=%r' % (k,v) for k,v in self.kwargs.items())
Expand Down Expand Up @@ -1055,7 +1057,7 @@ def _cache(self, key, val):
if len(self) >= cache_size:
first_key = next(k for k in self.data)
self.data.pop(first_key)
self.data[key] = val
self[key] = val


def map(self, map_fn, specs=None, clone=True):
Expand Down

0 comments on commit 8f3fcdd

Please sign in to comment.