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 formatting and add convert_to_lower flag to elementary.generate_schema_baseline_test #444

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Arun-kc
Copy link
Contributor

@Arun-kc Arun-kc commented Jul 29, 2023

Description:

This pull request addresses the issue #810 where the output of elementary.generate_schema_baseline_test has incorrect indentation. It also introduces the convert_to_lower flag to control the case of data types in the output.

Changes:

  • Refactor the generate_schema_baseline_test macro to separate the YAML generation for models and sources into two separate macros.

  • Introduce the convert_to_lower flag as a parameter to the elementary.generate_schema_baseline_test operation. When set to True, the output will default to lowercase for data types.

With these modifications, the output will be correctly formatted, and users can now control the case of the output using the convert_to_lower flag.

{%- for column in columns %}
- name: {{ column.name }}
{%- if convert_to_lower %}
data_type: {{ column.dtype|lower }}
Copy link
Contributor

Choose a reason for hiding this comment

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

can you indent please? :)

- name: {{ node.name }}
columns:
{%- for column in columns %}
- name: {{ column.name }}
{%- if convert_to_lower %}
data_type: {{ elementary.get_column_data_type(column) | lower }}
Copy link
Contributor

Choose a reason for hiding this comment

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

indent here as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants