Skip to content

Simple JSON override interface - #4825

Merged
Tryneus merged 8 commits into
rethinkdb:nextfrom
asakatida:grandquista-simple-json-override
Nov 4, 2015
Merged

Tryneus merged 8 commits into
rethinkdb:nextfrom
asakatida:grandquista-simple-json-override

Conversation

@asakatida

Copy link
Copy Markdown

This depends on #4818

@danielmewes

Copy link
Copy Markdown
Member

You're awesome @grandquista ! :)

(mentioning @Tryneus to put this on your screen. I'm going to move #4818 and this one into the 2.2 milestone)

Comment thread drivers/python/rethinkdb/net.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The json_encoder and json_decoder code appears to be repeated verbatim for each type of connection. This code should probably be put straight into the Connection class, which is used as the base class for the different types - DefaultConnection, net_twisted.Connection, net_tornado.Connection, and net_asyncio.Connection.

Since this code is common to all the connection types (and doesn't really rely on any ConnectionInstance variables), Connection should just pull json_encoder and json_decorder out of the kwargs, and provide the _get_json_decoder and _get_json_encoder functions that the child classes will inherit.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I have changed the solution to use Connection properties and reduce code.

@Tryneus

Tryneus commented Oct 28, 2015

Copy link
Copy Markdown
Member

@grandquista - looks good, but I had a comment to try and reduce the code duplication. Thanks for submitting this!

@Tryneus

Tryneus commented Nov 4, 2015

Copy link
Copy Markdown
Member

Awesome, merging. Thanks again for the help, @grandquista!

Tryneus added a commit that referenced this pull request Nov 4, 2015
@Tryneus
Tryneus merged commit 02d4e6f into rethinkdb:next Nov 4, 2015
totalwindupflightsystems pushed a commit to totalwindupflightsystems/rethinkdb that referenced this pull request Aug 7, 2026
…-json-override

Simple JSON override interface
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