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

[CT-1184] [Feature] Exposures: stricter validation for name, support custom label #5606

Closed
3 tasks done
jtcohen6 opened this issue Aug 3, 2022 · 2 comments · Fixed by #5844
Closed
3 tasks done

[CT-1184] [Feature] Exposures: stricter validation for name, support custom label #5606

jtcohen6 opened this issue Aug 3, 2022 · 2 comments · Fixed by #5844
Labels
enhancement New feature or request exposures jira

Comments

@jtcohen6
Copy link
Contributor

jtcohen6 commented Aug 3, 2022

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

Describe the feature

Currently, it's possible to define an exposure like:

exposures:
  - name: My Cool Exposure
     ...

A surprising number of things will keep working:

$ dbt list --resource-type exposure
exposure:my_project.My Cool Exposure

The problem is that it's not guaranteed to work everywhere. In particular, the dbt-docs site DAG selection does not handle exposure names with spaces (#2970).

Rather than fix it everywhere, I'd prefer to adopt the same approach we'll be taking for metrics (#5456):

  • Have stricter parse-time validation on the name property of exposures: snake-case, alphanumeric characters, maybe periods (since this is supported for models)
  • Support a label property that can be used in external metadata, and contain whatever characters the heart desires
exposures:
  - name: my_cool_exposures
    label: My Cool Exposure
     ...

Describe alternatives you've considered

  • Continue to support whatever exposure names users want, and they only find out much later
  • Add tons of strict validation without supporting a custom human-friendly label

I don't like either very much!

Who will this benefit?

Are you interested in contributing this feature?

Perhaps :)

Anything else?

No response

@github-actions github-actions bot changed the title [Feature] Support "labels" on exposures, and stricter validation for names [CT-982] [Feature] Support "labels" on exposures, and stricter validation for names Aug 3, 2022
@jtcohen6 jtcohen6 changed the title [CT-982] [Feature] Support "labels" on exposures, and stricter validation for names [Feature] Exposures: stricter validation for na e, support custom label` Aug 3, 2022
@jtcohen6 jtcohen6 changed the title [Feature] Exposures: stricter validation for na e, support custom label` [Feature] Exposures: stricter validation for name, support custom label Aug 3, 2022
@emmyoop
Copy link
Member

emmyoop commented Aug 12, 2022

Can we combine the name validation portion of this tickets with #5456 so we could use a single name validation function and then just have a separate ticket for adding labels?

@emmyoop emmyoop added the Refinement Maintainer input needed label Aug 12, 2022
@emmyoop emmyoop added the jira label Sep 14, 2022
@github-actions github-actions bot changed the title [Feature] Exposures: stricter validation for name, support custom label [CT-1184] [Feature] Exposures: stricter validation for name, support custom label Sep 14, 2022
@jtcohen6
Copy link
Contributor Author

Handling the associated questions in the linked PR — removing the Refinement label for now

@jtcohen6 jtcohen6 removed the Refinement Maintainer input needed label Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request exposures jira
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants