dbt-labs / dbt-core

dbt enables data analysts and engineers to transform their data using the same practices that software engineers use to build applications.
https://getdbt.com
Apache License 2.0
9.22k stars 1.53k forks source link

[Feature] Unit tests should support Gherkin table style inputs #10252

Open Dikootje opened 3 weeks ago

Dikootje commented 3 weeks ago

Is this your first time submitting a feature request?

Describe the feature

It would be really nice if it's possible to support input data for unit tests in a Gherkin data table compatible style See examples

| firstName   | lastName | birthDate  |
| Annie M. G. | Schmidt  | 1911-03-20 |
| Roald       | Dahl     | 1916-09-13 |
| Astrid      | Lindgren | 1907-11-14 |

Describe alternatives you've considered

No response

Who will this benefit?

We have business users who have very little tech skills, but do understand the data that goes into and should come out of the models. They already have experience with Gherkin scripts.

Additional benefit is that this is more readable to humans than json formatted string. Especially when there's a larger amount of columns in the inputs and outputs

Are you interested in contributing this feature?

No response

Anything else?

No response

graciegoheen commented 2 weeks ago

Hi! Thanks so much for opening.

Additional benefit is that this is more readable to humans than json formatted string. Especially when there's a larger amount of columns in the inputs and outputs

This was a lot of our motivation on supporting the format: csv - have you given that format a try? Here's the docs! I'd be curious to hear how you think Gherkin compares to csv. To me, they seem very similar (csv using ,, Gherkin using | as the delimiter between values), and we want to avoid supporting too many / redundant formats.