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

Add delete --attribute option #120

Merged
merged 3 commits into from
May 24, 2019

Conversation

tommydeboer
Copy link
Collaborator

@tommydeboer tommydeboer commented Apr 19, 2019

mcmd delete --entity-type dataset --attribute name
mcmd delete dataset --attribute name

Checklist

  • Functionality works & meets specifications
  • Code reviewed
  • Code unit/system tested
  • User documentation updated
  • Test plan template updated
  • Clean commits
  • Added Feature/Fix to release notes

Copy link
Contributor

@dennishendriksen dennishendriksen left a comment

Choose a reason for hiding this comment

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

Introducing encoding issues can be prevented by using the MOLGENIS Python API client that is responsible for escaping URL components. This client should use a RSQL client that is responsible for escaping query values.

if args.force or (not args.force and io.confirm(
'Are you sure you want to delete attribute {} of entity type {}?'.format(args.attribute, args.resource))):
io.start('Deleting attribute {} of entity {}'.format(highlight(args.attribute), highlight(args.resource)))
response = client.get(urljoin(config.api('rest2'),
Copy link
Contributor

Choose a reason for hiding this comment

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

encoding issues (see comments in #118)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Encoding will be done in the api module as soon as #118 is merged

'sys_md_Attribute?q=entity=={};name=={}'.format(args.resource,
args.attribute)))
attribute_id = response.json()['items'][0]['id']
client.delete(urljoin(config.api('rest2'), 'sys_md_Attribute/{}'.format(attribute_id)))
Copy link
Contributor

Choose a reason for hiding this comment

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

encoding issues (see comments in #118)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Encoding will be done in the api module as soon as #118 is merged

@marikaris marikaris merged commit 568da4a into molgenis:master May 24, 2019
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.

3 participants