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

Added functionality to a Datasource for deleting a section from the XML #68

Merged
merged 2 commits into from
Oct 11, 2023

Conversation

JustinGrilli
Copy link
Collaborator

@JustinGrilli JustinGrilli commented Oct 11, 2023

Summary

In some cases we may want to delete an entire section from a Datasource.
We can utilize the built in del Python syntax to delete a section; i.e. del Datasource.columns

Changes

  • Created a function: Datasource.__remove_section_from_parent
    • For removing a section from a parent Element
  • Implemented Datasource.__delattr__ to call __remove_section_from_parent
  • Replaced repeated code in Datasource.save function to use __remove_section_from_parent
  • Added a test for del Datasource.section functionality

Tests

  • Used del Datasource.<section>:
    • del datasource.extract
    • datasource.save()
    • Confirmed extract was removed from the XML

@JustinGrilli JustinGrilli merged commit 711d8aa into main Oct 11, 2023
1 check passed
@JustinGrilli JustinGrilli deleted the add-functionality-delete-datasource-section branch October 11, 2023 22:49
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.

None yet

1 participant