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

[release/v1.0] Fix bug when exporting a predicate name to the schema. #3701

Merged
merged 2 commits into from
Jul 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions worker/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,9 @@ func toRDF(pl *posting.List, prefix string, readTs uint64) (*bpb.KVList, error)
func toSchema(attr string, update pb.SchemaUpdate) (*bpb.KVList, error) {
// bytes.Buffer never returns error for any of the writes. So, we don't need to check them.
var buf bytes.Buffer
if strings.ContainsRune(attr, ':') {
buf.WriteRune('<')
buf.WriteString(attr)
buf.WriteRune('>')
} else {
buf.WriteString(attr)
}
buf.WriteRune('<')
buf.WriteString(attr)
buf.WriteRune('>')
buf.WriteByte(':')
if update.List {
buf.WriteRune('[')
Expand Down
2 changes: 1 addition & 1 deletion worker/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ func TestToSchema(t *testing.T) {
Lang: true,
},
},
expected: "Alice:string @reverse @count @lang @upsert . \n",
expected: "<Alice>:string @reverse @count @lang @upsert . \n",
},
{
skv: &skv{
Expand Down