-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
[ci] prevent lgb.model
and lgb.pkl
files being left behind after testing
#6518
[ci] prevent lgb.model
and lgb.pkl
files being left behind after testing
#6518
Conversation
262bfa8
to
bed0201
Compare
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.
Thanks so much for working on this! Please see my first round of suggestions.
X, y = make_synthetic_regression() | ||
params = {"objective": "regression", "verbose": -1} | ||
num_train_rounds = 2 | ||
lgb_train = lgb.Dataset(X, y, free_raw_data=False) | ||
bst = lgb.train(params=params, train_set=lgb_train, num_boost_round=num_train_rounds) | ||
preds_raw = bst.predict(X, raw_score=True) | ||
model_path_txt = str(tmp_path / "lgb.model") |
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.
Since this was already using tmp_path
, I think it's very unlikely that this one was leaving a file behind. Could you please revert the changes to this case and any others that were already using tmp_path
?
tmp_path
to prevent lgb.model
and lgb.pkl
files being left behind after testingtmp_path
to prevent lgb.model
and lgb.pkl
files being left behind after testing
tmp_path
to prevent lgb.model
and lgb.pkl
files being left behind after testinglgb.model
and lgb.pkl
files being left behind after testing
This reverts commit bed0201.
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.
Thanks very much! I pulled this branch and ran the tests, confirmed that there now lgb.model
and lgb.pkl
aren't left behind.
contributes to: #6361
Specificially prevents
lgb.pkl
andlgb.model
files from being left behind after running tests by using pytest'stmp_path
fixture. One can use the reprex described in #6361 (comment) to confirm these files are no longer left behind after these changes.