Skip to content

Commit

Permalink
Stop throwing errors on non-alnum field names; it messes with other h…
Browse files Browse the repository at this point in the history
…acks
  • Loading branch information
mikeboers committed Oct 28, 2015
1 parent e93e678 commit b34eeb4
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions sgschema/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,13 @@ def resolve_entity(self, entity_spec, implicit_aliases=True, strict=False):
return [self.entity_aliases[entity_spec[1:]]]
except KeyError:
return []
if not op.isalnum():
raise ValueError('unknown entity operation for %r' % entity_spec)

# We used to raise an exception if not op.isalnum(), but then we found
# that sometimes other tools stuff data into an entity (e.g. __path__
# in the SGFS command parse_spec utility function) as a hack.
# An exception there would break that hack. While we would like to
# fail as fast and hard as we can, it seems generally reasonable that
# this sort of failure would be easy enough to track down later.

# Actual entity names have preference over implicit aliases.
if entity_spec in self.entities:
Expand Down Expand Up @@ -326,8 +331,9 @@ def _resolve_field(self, entity_spec, field_spec, auto_prefix=True, implicit_ali
# We need to maintain $FROM$, and we want this to fail
# if it gets to Shotgun.
return [field_spec]
if not op.isalnum():
raise ValueError('unknown field operation for %s %r' % (entity_spec, field_spec))

# We used to raise an exception if not op.isalnum(); see resolve_entity
# for why we don't do that anymore.

# Actual field names have preference over automatic prefixes or
# implicit aliases.
Expand Down

0 comments on commit b34eeb4

Please sign in to comment.