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

Remove TODO expr in filters #70

Closed
wants to merge 1 commit into from

Conversation

sfc-gh-jhilgart
Copy link
Collaborator

Currently, we're adding default filters that include a blank expr. However, during validation this returns an error. Now, the default filter will pass validation, but not add value until a user updates it.

@@ -314,7 +314,7 @@ def mock_dependencies_exceed_context(mock_snowflake_connection):
def test_raw_schema_to_semantic_context(
mock_dependencies, mock_snowflake_connection, mock_snowflake_connection_env
):
want_yaml = "name: this is the best semantic model ever\ntables:\n - name: ALIAS\n description: some table comment\n base_table:\n database: TEST_DB\n schema: SCHEMA_TEST\n table: ALIAS\n filters:\n - name: ' '\n synonyms:\n - ' '\n description: ' '\n expr: ' '\n dimensions:\n - name: ZIP_CODE\n synonyms:\n - ' '\n description: some column comment\n expr: ZIP_CODE\n data_type: TEXT\n time_dimensions:\n - name: BAD_ALIAS\n synonyms:\n - ' '\n description: ' '\n expr: BAD_ALIAS\n data_type: TIMESTAMP\n measures:\n - name: AREA_CODE\n synonyms:\n - ' '\n description: ' '\n expr: AREA_CODE\n data_type: NUMBER\n - name: CBSA\n synonyms:\n - ' '\n description: ' '\n expr: CBSA\n data_type: NUMBER\n"
want_yaml = "name: this is the best semantic model ever\ntables:\n - name: ALIAS\n description: some table comment\n base_table:\n database: TEST_DB\n schema: SCHEMA_TEST\n table: ALIAS\n filters:\n - name: ' '\n synonyms:\n - ' '\n description: ' '\n dimensions:\n - name: ZIP_CODE\n synonyms:\n - ' '\n description: some column comment\n expr: ZIP_CODE\n data_type: TEXT\n time_dimensions:\n - name: BAD_ALIAS\n synonyms:\n - ' '\n description: ' '\n expr: BAD_ALIAS\n data_type: TIMESTAMP\n measures:\n - name: AREA_CODE\n synonyms:\n - ' '\n description: ' '\n expr: AREA_CODE\n data_type: NUMBER\n - name: CBSA\n synonyms:\n - ' '\n description: ' '\n expr: CBSA\n data_type: NUMBER\n"
Copy link
Collaborator

Choose a reason for hiding this comment

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

oh, the expr is also auto-populated for filters.
I thought this model'll still be broken without expr for filters?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You're right. Looking

Copy link
Collaborator

Choose a reason for hiding this comment

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

one thought maybe we mark the whole filter area as comments.... and let user know you can uncomment if you want to add filter

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I thought this was the issue, but turns out this is a valid filter.

    filters:
      - name: '  ' # <FILL-OUT>
        synonyms:
          - '  ' # <FILL-OUT>
        description: '  ' # <FILL-OUT>
        expr: '  ' # <FILL-OUT>

And we already include the col name in the expr (so we are generating valid yaml in this generator).

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.

2 participants