Skip to content

Commit ca932d3

Browse files
authored
Merge pull request #13 from highcharts-for-python/develop
PR for v.1.0.0-rc3
2 parents 1fe4ce4 + e9eaa96 commit ca932d3

File tree

7 files changed

+40
-54
lines changed

7 files changed

+40
-54
lines changed

CHANGES.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
Release 1.0.0-rc3
2+
=========================================
3+
4+
* Fixed unneeded ``python-dotenv`` import.
5+
* Suppressed Asana irrelevant deprecation warnings.
6+
* Suppressed Asana custom ``dict`` population
7+
(possibly revisit in a later version).
8+
* Fixed JavaScript module inclusion logic in Jupyter context.
9+
10+
-----------------
11+
112
Release 1.0.0-rc2
213
=========================================
314

highcharts_gantt/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '1.0.0-rc2'
1+
__version__ = '1.0.0-rc3'

highcharts_gantt/chart.py

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from highcharts_stock.chart import Chart as ChartBase
66

7-
from highcharts_gantt import constants, errors
7+
from highcharts_gantt import constants, errors, utility_functions
88
from highcharts_gantt.options import (HighchartsOptions,
99
HighchartsStockOptions,
1010
HighchartsGanttOptions)
@@ -447,38 +447,6 @@ def from_series(cls, *series, kwargs = None):
447447

448448
instance.add_series(series)
449449

450-
def display(self, global_options = None):
451-
"""Display the chart in `Jupyter Labs <https://jupyter.org/>`_ or
452-
`Jupyter Notebooks <https://jupyter.org/>`_.
453-
454-
:raises HighchartsDependencyError: if
455-
`ipython <https://ipython.readthedocs.io/en/stable/>`_ is not available in the
456-
runtime environment
457-
"""
458-
try:
459-
from IPython import display
460-
except ImportError:
461-
raise errors.HighchartsDependencyError('Unable to import IPython.display. '
462-
'Make sure that it is available in '
463-
'your runtime environment. To install,'
464-
'use: pip install ipython')
465-
466-
if global_options is not None:
467-
global_options = validate_types(global_options,
468-
types = SharedGanttOptions)
469-
470-
if self.is_gantt_chart:
471-
include_str = constants.GANTT_INCLUDE_STR
472-
else:
473-
include_str = constants.INCLUDE_STR
474-
475-
html_str = include_str + '\n'
476-
if global_options:
477-
html_str += global_options._repr_html_() + '\n'
478-
html_str += self._repr_html_()
479-
480-
display.display_html(html_str, raw = True)
481-
482450
@staticmethod
483451
def _get_options_obj(series_type, options_kwargs):
484452
"""Return an :class:`Options` descendent based on the series type.

highcharts_gantt/constants.py

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
"""Defines a set of constants that are used throughout the library."""
2-
from highcharts_core.constants import *
2+
from highcharts_stock.constants import *
33

4-
5-
GANTT_INCLUDE_LIBS = [
4+
GANTT_INCLUDE_LIBS = [x for x in STOCK_INCLUDE_LIBS]
5+
GANTT_INCLUDE_LIBS.extend([
66
"https://code.highcharts.com/gantt/modules/gantt.js",
7-
"https://code.highcharts.com/stock/highcharts-more.js",
8-
"https://code.highcharts.com/stock/highcharts-more.src.js",
9-
"https://code.highcharts.com/stock/modules/exporting.js",
10-
"https://code.highcharts.com/stock/modules/exporting.src.js",
11-
"https://code.highcharts.com/stock/modules/drilldown.js",
12-
"https://code.highcharts.com/stock/modules/drilldown.src.js",
13-
"https://code.highcharts.com/stock/modules/solid-gauge.js",
14-
"https://code.highcharts.com/stock/modules/solid-gauge.src.js"
15-
]
7+
])
168

17-
GANTT_INCLUDE_STR = """<script src="https://code.highcharts.com/gantt/modules/gantt.js"></script>"""
9+
GANTT_INCLUDE_STR = STOCK_INCLUDE_STR + """
10+
<script src="https://code.highcharts.com/gantt/modules/gantt.js"/>
11+
"""
1812

1913

2014
MONDAY_TEMPLATES = {

highcharts_gantt/headless_export.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
from dotenv import load_dotenv
1+
try:
2+
from dotenv import load_dotenv
3+
load_dotenv()
4+
except ImportError:
5+
pass
6+
27
from typing import Optional
38

49
from validator_collection import checkers
@@ -11,7 +16,6 @@
1116
SharedStockOptions,
1217
SharedGanttOptions)
1318

14-
load_dotenv()
1519

1620

1721
class ExportServer(ExportServerBase):

highcharts_gantt/options/series/data/gantt.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,11 @@ def from_array(cls, value):
431431
"""
432432
if not value:
433433
return []
434+
elif checkers.is_string(value):
435+
try:
436+
value = validators.json(value)
437+
except (ValueError, TypeError):
438+
pass
434439
elif not checkers.is_iterable(value):
435440
value = [value]
436441

@@ -531,7 +536,7 @@ def from_asana(cls,
531536
dependencies.append(connection)
532537

533538
data_point.dependency = dependencies
534-
data_point.custom = task
539+
#data_point.custom = task
535540

536541
return data_point
537542

highcharts_gantt/options/series/gantt.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import os
22
from typing import Optional, List
33

4-
from dotenv import load_dotenv
4+
try:
5+
from dotenv import load_dotenv
6+
load_dotenv()
7+
except ImportError:
8+
pass
9+
510
from validator_collection import validators, checkers
611

712
try:
@@ -24,9 +29,6 @@
2429
from highcharts_gantt.utility_functions import mro__to_untrimmed_dict
2530

2631

27-
load_dotenv()
28-
29-
3032
class GanttSeries(SeriesBase, GanttOptions):
3133
"""Options to configure a Gantt series.
3234
@@ -309,6 +311,8 @@ def load_from_asana(self,
309311
'Neither was supplied.')
310312
else:
311313
client = asana.Client.access_token(personal_access_token)
314+
315+
client.LOG_ASANA_CHANGE_WARNINGS = False
312316

313317
if section_gid:
314318
request = client.tasks.get_tasks_for_section

0 commit comments

Comments
 (0)