Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support document paths and attribute names containing dot characters. #322

Merged
merged 1 commit into from
Aug 8, 2017

Conversation

jpinner-lyft
Copy link
Contributor

@jpinner-lyft jpinner-lyft commented Aug 5, 2017

This PR introduces support for both Document Paths and '.' characters in expressions.

Expressions are generated assuming that the path given in the object is a document path;
for example, Path('foo.bar.baz[0]') == value is translated into #0.#1.#2[0] = :0 with the following expression attribute names: {'#0': 'foo', '#1': 'bar', "#2': 'baz'}.

With this change, expressions generated from Attribute objects will use whatever attribute name is defined by the attr_name field, allowing support for dotted attribute names; for example,
ListAttribute(attr_name='foo.bar.baz')[0] == value is translated into #0[0] = :0 with the following expression attribute names: {'#0: 'foo.bar.baz'}.

def __init__(self, attribute, prefix):
super(BeginsWith, self).__init__(attribute, 'begins_with', prefix)
def __init__(self, path, prefix):
super(BeginsWith, self).__init__(path, 'begins_with', prefix)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const?

Copy link
Contributor Author

@jpinner-lyft jpinner-lyft Aug 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the current BEGINS_WITH const is for the old api which is capitalized and not lowercase

@jpinner-lyft jpinner-lyft merged commit 9e01729 into master Aug 8, 2017
@jpinner-lyft jpinner-lyft deleted the document-paths branch August 8, 2017 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants