-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Revamp streaming #253
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
Closed
Closed
Revamp streaming #253
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
7b3ec4c
remove embed tests, they’re just skipped.
theengineear b83a151
add __init__.py for offline test packages.
theengineear fce9ba3
prettify tests and update imports
theengineear 7c4aa32
remove python 2.6 stuff from setup.py
theengineear df4fafb
remove python 2.6 stuff from requirements.txt
theengineear 4afa886
adjust imports to not cater to python 2.6!
theengineear 2e4a74d
organize the rest of our imports.
theengineear e11bdc2
pep:8ball: comments
theengineear d2cbd6d
we can use dictionary comprehensions now, yay!
theengineear f60f811
fixed up a few imports :)
theengineear f6ad1c6
get the right urlparse from six.moves.
theengineear 907bf41
i had deleted the wrong duplicated test.
theengineear 3c73ca2
Add connection exceptions specific to streaming.
theengineear 630005a
Add new `DisconnectThread` utility class.
theengineear 1881cd1
Add utility function to parse raw HTTP strings.
theengineear fb07014
Incluse asyncio, trollius, backport in deps.
theengineear b28fdf3
Add fully async `StreamWriter` for streaming.
theengineear File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,21 +15,14 @@ | |
|
||
|
||
""" | ||
import sys | ||
import six | ||
import json | ||
|
||
if sys.version[:3] == '2.6': | ||
import simplejson as json | ||
else: | ||
import json | ||
|
||
## Base Plotly Error ## | ||
|
||
# Base Plotly Error | ||
class PlotlyError(Exception): | ||
pass | ||
|
||
|
||
|
||
class InputError(PlotlyError): | ||
pass | ||
|
||
|
@@ -63,8 +56,7 @@ def __str__(self): | |
return self.message | ||
|
||
|
||
## Grid Errors ## | ||
|
||
# Grid Errors # | ||
COLUMN_NOT_YET_UPLOADED_MESSAGE = ( | ||
"Hm... it looks like your column '{column_name}' hasn't " | ||
"been uploaded to Plotly yet. You need to upload your " | ||
|
@@ -79,14 +71,14 @@ def __str__(self): | |
"can't have duplicate column names. Rename " | ||
"the column \"{0}\" and try again." | ||
) | ||
## Would Cause Server Errors ## | ||
|
||
# Would Cause Server Errors | ||
|
||
class PlotlyEmptyDataError(PlotlyError): | ||
pass | ||
|
||
|
||
## Graph Objects Errors ## | ||
|
||
# Graph Objects Errors | ||
class PlotlyGraphObjectError(PlotlyError): | ||
def __init__(self, message='', path=None, notes=None, plain_message=''): | ||
self.message = message | ||
|
@@ -202,8 +194,7 @@ def __init__(self, obj='', index='', **kwargs): | |
**kwargs) | ||
|
||
|
||
## Local Config Errors ## | ||
|
||
# Local Config Errors | ||
class PlotlyLocalError(PlotlyError): | ||
pass | ||
|
||
|
@@ -224,8 +215,7 @@ def __init__(self): | |
super(PlotlyLocalCredentialsError, self).__init__(message) | ||
|
||
|
||
## Server Errors ## | ||
|
||
# Server Errors | ||
class PlotlyServerError(PlotlyError): | ||
pass | ||
|
||
|
@@ -244,3 +234,20 @@ class PlotlyAccountError(PlotlyServerError): | |
|
||
class PlotlyRateLimitError(PlotlyServerError): | ||
pass | ||
|
||
|
||
class ClosedConnection(PlotlyConnectionError): | ||
"""Raised when the Plotly streaming server has disconnected.""" | ||
def __init__(self, message, status_code=None): | ||
self.message = "[Code: {}] {}".format(status_code, message) | ||
self.status_code = status_code or None | ||
super(ClosedConnection, self).__init__(self.message) | ||
|
||
|
||
class TooManyConnectFailures(PlotlyConnectionError): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice |
||
"""Raised when too many unsuccessful (re)connects were attempted""" | ||
message = "Connecting or reconnecting to stream failed too many times." | ||
|
||
def __init__(self, message=None): | ||
message = message or self.message | ||
super(TooManyConnectFailures, self).__init__(message) |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
plot_mpl, | ||
get_figure, | ||
Stream, | ||
StreamWriter, | ||
image, | ||
grid_ops, | ||
meta_ops, | ||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, way better.