Skip to content

Commit

Permalink
Refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
shrverma committed Jul 29, 2023
1 parent 0e2f335 commit a422223
Showing 1 changed file with 1 addition and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,25 +79,5 @@ public void invalidRelationTest () {
Assert.assertEquals(invalidrelation.getValidationError(),
wrangler.transform(null, relation).getValidationError());
}

public static Relation runTransform(String[] recipe,
RelationalTranformContext relationalTranformContext,
Relation relation)
throws DirectiveParseException, RecipeException {
DirectiveRegistry registry;
registry = SystemDirectiveRegistry.INSTANCE;
try {
registry.reload("default");
} catch (DirectiveLoadException e) {
throw new RuntimeException(e);
}

GrammarBasedParser parser = new GrammarBasedParser("default",
new MigrateToV2(recipe).migrate(), registry);
List<Directive> directives = parser.parse();
for (Directive directive : directives) {
relation = directive.transform(relationalTranformContext, relation);
}
return relation;
}

}

0 comments on commit a422223

Please sign in to comment.