Skip to content
New issue

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

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

Already on GitHub? # to your account

Snake case #16

Merged
merged 9 commits into from
Oct 13, 2022
Merged

Snake case #16

merged 9 commits into from
Oct 13, 2022

Conversation

leslievandemark
Copy link
Collaborator

@leslievandemark leslievandemark commented Oct 11, 2022

Description of change

Transforms field names to be lowercase and snakecase, so that they will always match in the destination. The api field name is stored as metadata under tap-ga4.api-field-names to be used in requests.

Manual QA steps

  • ran sync/discovery locally

Risks

  • low, no alpha testers yet

Rollback steps

  • revert this branch

@@ -81,7 +83,10 @@ def generate_base_schema():



def generate_metadata(schema, dimensions, metrics, field_exclusions):
def to_snakecase(name):
return re.sub(r'(?<!^)(?=[A-Z])', '_', name).lower()
Copy link
Contributor

Choose a reason for hiding this comment

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

regex is so obnoxious, but it looks good to me.

@leslievandemark leslievandemark merged commit 8a11b9a into main Oct 13, 2022
@leslievandemark leslievandemark deleted the snake_case branch October 13, 2022 17:39
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants