Skip to content

Commit

Permalink
Merge pull request #170 from kujira7/fuzzy_matching_from_snake_to_pascal
Browse files Browse the repository at this point in the history
fuzzy matching on column name for inheritance(snake_case to PascalCase)
  • Loading branch information
z3z1ma authored Jul 10, 2024
2 parents 22ae16b + c713aa4 commit 53e5a8f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/dbt_osmosis/core/column_level_knowledge.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ def get_prior_knowledge(
column: str,
) -> ColumnLevelKnowledge:
camel_column = re.sub("_(.)", lambda m: m.group(1).upper(), column)
pascal_column = camel_column[0].upper() + camel_column[1:]
prior_knowledge_candidates = list(
filter(
lambda k: k,
[
knowledge.get(column),
knowledge.get(column.lower()),
knowledge.get(camel_column),
knowledge.get(pascal_column),
],
)
)
Expand Down

0 comments on commit 53e5a8f

Please sign in to comment.