Pandas XML Reader and Writer Class #356
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request adds XML read and write functionality for ticket #352
Changes
This code adds the functionality to read and write using the Pandas XML functions to Hamilton.
read_xml
: https://pandas.pydata.org/docs/reference/api/pandas.read_xml.htmlto_xml
: https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_xml.htmlThe changes to the files are as described below:
pandas_extensions.py
: Added the functions to read and write XML filesmy_script.py
: Added the example of XML materialization and optional to add Hamilton to PATH with directorynotebook.ipynb
: Added the example of XML materialization and optional to add Hamilton to PATH with directoryrequirements-test.txt
: Added the module lxml since it is a requirement for the parser argument when reading XML filestest_pandas_extensions.py
: Added test cases for the read_xml and to_xml functions that are called PandasXmlReader and PandasXmlWriter respectivelytest_load_from_data.xml
: A simple XML file with example data to test functionalityHow I tested this
I used the pre-commit package and all tests passed before committing, there is also the circleci tests. A screenshot of the most recent commit is below:
pre-commit:
Notes
Checklist