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

Feature/improved graph selection #279

Merged
merged 31 commits into from
Feb 17, 2017

Conversation

drewbanin
Copy link
Contributor

@drewbanin drewbanin commented Feb 7, 2017

This works:

# - run tests for models in ./models/some_dir/**
# - run tests for all snowplow models EXCEPT snowplow_id_map and its children
$ dbt test --models test_project.some.dir.* snowplow.* --exclude 'snowplow_id_map+'

Models

  • select models by filesystem hierarchy
  • select models by package
  • select parents of model
  • select children of model
  • exclude models by above criteria

Schema Testing

  • source tests from inside of packages
  • select tests by package
  • select tests by model hierarchy
  • select tests by parents of model
  • select tests by children of model
  • exclude tests by above criteria

Custom Data Testing

  • source tests from inside of packages
  • select tests by package
  • select tests by model hierarchy
  • select tests by parents of model
  • select tests by children of model
  • exclude tests by above criteria

Remaining Todo

  • Remove this package selector
  • allow --models to be take a space-separated string

@drewbanin
Copy link
Contributor Author

This branch also fixes #266

Copy link
Member

@cmcarthur cmcarthur left a comment

Choose a reason for hiding this comment

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

@drewbanin did you ever figure out why the tests were mysteriously passing when the code was actually broken?

This looks great. If we understand why the tests were incorrectly passing before, then :shipit:

(Also, don't forget to add a line to the CHANGELOG)

@@ -23,6 +23,8 @@
"models", "data tests", "schema tests", "archives", "analyses"
]

GraphFile = 'graph.yml'
Copy link
Member

Choose a reason for hiding this comment

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

nitpicky but why not call this graph_file_name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

test(('X', 'a'), ('b'), False)
test(('X', 'a'), ('X', 'b'), False)
test(('X', 'a'), ('X', 'a', 'b'), False)
test(('X', 'a'), ('Y', '*'), False)
Copy link
Member

Choose a reason for hiding this comment

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

HOLY SHIT THESE ARE GREAT

@drewbanin
Copy link
Contributor Author

@cmcarthur the typo in the update.sql file here never failed for a couple of reasons:

  • 003_* tests run after the 001_* tests, so the table we were inserting into always existed
  • The 003 test was set up as "run, update, run again". Since the update was a nop, the assertions after the "update" just re-asserted what we had confirmed before the update.
  • We also failed to update the summary_expected table to be consistent with the newly inserted data.

Now in the "update", we 1) insert into the correct table and 2) change the value of summary_expected to be consistent w/ the newly inserted data here.

@drewbanin
Copy link
Contributor Author

@cmcarthur great, going to add those changelog lines then merge later today

@drewbanin
Copy link
Contributor Author

cc @jthandy

@drewbanin drewbanin merged commit ff3aa6e into development Feb 17, 2017
@drewbanin drewbanin deleted the feature/improved-graph-selection branch March 25, 2017 20:25
yu-iskw pushed a commit to yu-iskw/dbt that referenced this pull request Aug 17, 2021
Remove errant default args from get_tables_by_pattern_sql
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