Skip to content
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

python: fix python 3.8 Syntax Warning #2262

Merged
merged 1 commit into from
Mar 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/python/plotly/_plotly_utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class NotEncodable(Exception):
def iso_to_plotly_time_string(iso_string):
"""Remove timezone info and replace 'T' delimeter with ' ' (ws)."""
# make sure we don't send timezone info to plotly
if (iso_string.split("-")[:3] is "00:00") or (iso_string.split("+")[0] is "00:00"):
if (iso_string.split("-")[:3] == "00:00") or (iso_string.split("+")[0] == "00:00"):
raise Exception(
"Plotly won't accept timestrings with timezone info.\n"
"All timestrings are assumed to be in UTC."
Expand Down
4 changes: 2 additions & 2 deletions packages/python/plotly/plotly/figure_factory/_candlestick.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,12 @@ def create_candlestick(open, high, low, close, dates=None, direction="both", **k
utils.validate_equal_length(open, high, low, close)
validate_ohlc(open, high, low, close, direction, **kwargs)

if direction is "increasing":
if direction == "increasing":
candle_incr_data = make_increasing_candle(
open, high, low, close, dates, **kwargs
)
data = candle_incr_data
elif direction is "decreasing":
elif direction == "decreasing":
candle_decr_data = make_decreasing_candle(
open, high, low, close, dates, **kwargs
)
Expand Down
4 changes: 2 additions & 2 deletions packages/python/plotly/plotly/figure_factory/_ohlc.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ def create_ohlc(open, high, low, close, dates=None, direction="both", **kwargs):
utils.validate_equal_length(open, high, low, close)
validate_ohlc(open, high, low, close, direction, **kwargs)

if direction is "increasing":
if direction == "increasing":
ohlc_incr = make_increasing_ohlc(open, high, low, close, dates, **kwargs)
data = [ohlc_incr]
elif direction is "decreasing":
elif direction == "decreasing":
ohlc_decr = make_decreasing_ohlc(open, high, low, close, dates, **kwargs)
data = [ohlc_decr]
else:
Expand Down
4 changes: 2 additions & 2 deletions packages/python/plotly/plotly/matplotlylib/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ def draw_path_collection(self, **props):

"""
self.msg += " Attempting to draw a path collection\n"
if props["offset_coordinates"] is "data":
if props["offset_coordinates"] == "data":
markerstyle = mpltools.get_markerstyle_from_collection(props)
scatter_props = {
"coordinates": "data",
Expand Down Expand Up @@ -569,7 +569,7 @@ def draw_text(self, **props):
self.draw_title(**props)
else: # just a regular text annotation...
self.msg += " Text object is a normal annotation\n"
if props["coordinates"] is not "data":
if props["coordinates"] != "data":
self.msg += (
" Text object isn't linked to 'data' " "coordinates\n"
)
Expand Down