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 8be0d5b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 1 addition & 5 deletions holoviews/core/dimension.py
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
6 changes: 5 additions & 1 deletion holoviews/core/spaces.py
Expand Up @@ -518,6 +518,10 @@ def __call__(self, *args, **kwargs):

try:
ret = self.callable(*args, **kwargs)
except KeyError:
# KeyError is caught separately because it is used to signal
# invalid keys on DynamicMap and should not warn
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 +1059,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 8be0d5b

Please sign in to comment.