-
Notifications
You must be signed in to change notification settings - Fork 328
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
Adds command spp model remove
. Closes #6118
#6410
Conversation
Thank you, well try to review it ASAP! |
5afaf7c
to
9a84d0e
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.
Nice stuff, I made a few comments along the way. Could you take a look at them, please?
9a84d0e
to
53f4c24
Compare
@mkm17 I added the |
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.
Nice work, let's do a couple of more changes.
53f4c24
to
e4e531d
Compare
Hi @milanholemans, ok thank you for the review. You are right, I now understand the odata.null case. |
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.
We're almost there, let's do a couple of more changes.
e4e531d
to
3e2c005
Compare
@milanholemans I hope the changes to the tests are fine. I've included the same check for the |
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.
Apart from a few tiny remarks, it looks good to me!
option: '-t, --title [title]' | ||
}, | ||
{ | ||
option: '-f --force' |
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.
option: '-f --force' | |
option: '-f, --force' |
public async commandAction(logger: Logger, args: CommandArgs): Promise<void> { | ||
try { | ||
if (!args.options.force) { | ||
const confirmationResult = await cli.promptForConfirmation({ message: `Are you sure you want to remove model '${args.options.title ? args.options.title : args.options.id}'?` }); |
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.
const confirmationResult = await cli.promptForConfirmation({ message: `Are you sure you want to remove model '${args.options.title ? args.options.title : args.options.id}'?` }); | |
const confirmationResult = await cli.promptForConfirmation({ message: `Are you sure you want to remove model '${args.options.title ?? args.options.id}'?` }); |
assert(stubDelete.calledOnce); | ||
}); | ||
|
||
it('deletes model by title with .classifier suffic', async () => { |
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.
it('deletes model by title with .classifier suffic', async () => { | |
it('deletes model by title with .classifier suffix', async () => { |
it('deletes model by title with .classifier suffic', async () => { | ||
const stubDelete = sinon.stub(request, 'delete').callsFake(async (opts) => { | ||
if (opts.url === `https://contoso.sharepoint.com/sites/portal/_api/machinelearning/models/getbytitle('modelname.classifier')`) { | ||
return ''; |
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.
return ''; | |
return; |
it('deletes model by title', async () => { | ||
const stubDelete = sinon.stub(request, 'delete').callsFake(async (opts) => { | ||
if (opts.url === `https://contoso.sharepoint.com/sites/portal/_api/machinelearning/models/getbytitle('modelname.classifier')`) { | ||
return ''; |
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.
return ''; | |
return; |
Merged manually, thank you! |
Adds command
spp model remove
. Closes #6118