Skip to content

Add message representation#6

Merged
mdelaurentis merged 9 commits into
masterfrom
add-message-representation
Feb 24, 2017
Merged

Add message representation#6
mdelaurentis merged 9 commits into
masterfrom
add-message-representation

Conversation

@mdelaurentis

@mdelaurentis mdelaurentis commented Feb 24, 2017

Copy link
Copy Markdown
Contributor

As we start to add more targets, we'll want a common way to parse output from taps. This adds a singer.parse_message function that takes a JSON line and returns an object that represents the message.

  • Add three new namedtuple classes to represent message data.
    • RecordMessage
    • SchemaMessage
    • StateMessage
  • Convert the write_record, write_schema, and write_state functions to use those classes.
  • Add a parse_message function that takes a string and returns an instance of one of the message classes.
  • Add unit tests

@cmerrick

Copy link
Copy Markdown
Contributor

I like it. We should use this in targets too, right?

@mdelaurentis

Copy link
Copy Markdown
Contributor Author

@cmerrick yes, I'm changing target-stitch to use it now.

@mdelaurentis mdelaurentis merged commit e0e5fc7 into master Feb 24, 2017
@mdelaurentis mdelaurentis deleted the add-message-representation branch February 24, 2017 19:25
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