-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
do not try to remove remote after dbt init #1210
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some style-ish comments, lgtm with or without them
return "test/integration/040_init_test/models" | ||
|
||
@use_profile('postgres') | ||
def test_init_task(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you put _postgres_
in the name here you will avoid a UserWarning
.
if os.path.exists(project_name): | ||
shutil.rmtree(project_name) | ||
|
||
DBTIntegrationTest.tearDown(self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super(TestInit, self).tearDown()
is the canonical syntax for this, though it isn't very important here.
project_file_exists = os.path.exists(project_file) | ||
|
||
self.assertTrue(dir_exists) | ||
self.assertTrue(project_file_exists) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also assert that there is no .git
?
@beckjake just made some changes per your feedback. Will merge when the tests pass |
@drewbanin Today I encountered the same problem, and I've just upgraded dbt but remote link is still removed from my cloned repo. error:
|
hey @hoanghapham - this PR fixed a bug wherein dbt would try to remove the remote after deleting the I'm not so sure I understand the |
oh ok, actually I got that error when I tried to upgrade dbt today. |
Hey @hoanghapham - we do this so new users start with a clean slate. If we didn't remove the If you have suggestions for how |
Thanks. I have a master I think this behavior should also be mentioned in the docs as you encourage using version control in analytics. |
@hoanghapham are you saying that dbt is removing the remote of your root project? I think that was the behavior of the 0.12.2rc1 release, which was fixed by this PR! I was able to replicate the behavior you described with 0.12.2rc1, but not with 0.12.2. |
ah yes, that's the problem, sorry for not being specific.
However, |
yeah, no prob! I just tried out |
Thanks @drewbanin , will do tomorrow. Please let me know what kind of info you will need. |
Fixes #1209 by removing a call to delete the remote from the cloned repo. The entire .git dir is deleted right before this, so the command previously could not succeed