-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gdt 82 transformer class refactor (#106)
* Rename Transformer > XmlTransformer * Rename Transformer > XmlTransformer to prepare for new base class * Rename xml arg to source_record for XmlTransformer methods * Create Transformer base class Why these changes are being introduced: * A format-agnostic Transformer base class is needed for deriving both XmlTransformer and JsonTransformer format classes How this addresses that need: * Create a Transformer base class * Add JSON type for validation * Refactor XmlTransformer to derive from Transformer class * Rename arg xml > source_record and update docstrings Side effects of this change: * None Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/GDT-82 * Rename input_records > source_records across repo * Add parse_source_records method Why these changes are being introduced: * parse_xml_records is a function in the helpers module that will be replaced by a method in the Transformer base class How this addresses that need: * Add parse_source_records method to Transformer base class as an abstractmethod * Add parse_source_records to XmlTransformer class and corresponding unit test Side effects of this change: * None Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/GDT-82 * Remove parse_xml_records function * Remove parse_xml_records function from helpers module and corresponding unit test * Replace all calls of that function with the appropriate class method * Update dependencies * Shift get_transformer to Transformer method * Shift get_transformer from config module to Transformer class staticmethod along with corresponding unit tests * Update CLI to call new method * Updates based on discussion in PR #106 * Remove instance from transformer_instance variable name * Update write_timdex_records_to_json type hinting * Update get_transformer type hinting * Update docstrings * Add load and write_timdex_records_to_json methods * Add load and write_timdex_records_to_json methods to Transformer class * Remove write_timdex_records_to_json function from helpers module * Update CLI command with new methods * Update variable names and docstrings for consistency
- Loading branch information
Showing
24 changed files
with
764 additions
and
536 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.