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

Fix escaping of some edge identifiers like '$' #5122

Merged
merged 1 commit into from Jan 14, 2019

Conversation

Projects
None yet
2 participants
@tpoterba
Copy link
Collaborator

commented Jan 14, 2019

Fixes #5119

@@ -215,7 +215,7 @@ package object utils extends Logging
.filter(s => !s.isEmpty)

def prettyIdentifier(str: String): String = {
if (str.matches("""\p{javaJavaIdentifierStart}\p{javaJavaIdentifierPart}*"""))
if (str.matches("""[_a-zA-Z]\w*"""))

This comment has been minimized.

Copy link
@tpoterba

tpoterba Jan 14, 2019

Author Collaborator

this is much more conservative. There is no reason to use the java identifier stuff if we don't have a good idea what's in it -- apparently "currency" characters are valid identifier starts!

@@ -178,7 +178,10 @@ def unescape_parsable(s):


def escape_id(s):
return Env.jutils().escapeIdentifier(s)
if re.fullmatch(r'[_a-zA-Z]\w*', s):

This comment has been minimized.

Copy link
@tpoterba

tpoterba Jan 14, 2019

Author Collaborator

avoid some JVM trips

@danking
Copy link
Collaborator

left a comment

Did you also check that the rest of our stack correctly reads a column header with a dollar sign? I'm a little weary that another bug might show up when Nik tries.

@tpoterba

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 14, 2019

The rest of the stack does handle weird named fields, the problem was that this wasn't getting escaped correctly (well, that our python type parser had different assumptions about escaping than the string escaper).

@danking danking merged commit 562fc97 into hail-is:master Jan 14, 2019

1 check passed

hail-ci-0-1 successful build
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.