Skip to content

Commit 634220a

Browse files
authored
Merge pull request #20 from highcharts-for-python/develop
PR for v.1.0.0-rc2
2 parents 91e353e + b85326d commit 634220a

File tree

12 files changed

+171
-76
lines changed

12 files changed

+171
-76
lines changed

CHANGES.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
Release 1.0.0-rc2
2+
=========================================
3+
4+
* Closed #18. Fixed bug where loading data from a Pandas Dataframe could produce data points with None values.
5+
* Added ``HighchartsPandasDeserializationError`` and ``HighchartsPySparkDeserializationError``.
6+
7+
---------------
8+
19
Release 1.0.0-rc1
210
=========================================
311

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ The toolkit is composed of several different libraries, each of which provides c
2020
* - **Highcharts Core for Python**
2121
- `Highcharts Core (JS) <https://www.highcharts.com/products/highcharts/>`__
2222
- (this library) the core Highcharts data visualization library
23-
* - `Highcharts Stock for Python <https://highcharts-stock.readthedocs.io/>`__
23+
* - `Highcharts Stock for Python <https://stock-docs.highchartspython.com/>`__
2424
- `Highcharts Stock (JS) <https://www.highcharts.com/products/stock/>`__
2525
- the robust time series visualization extension to Highcharts Core
26-
* - `Highcharts Maps <https://highcharts-maps.readthedocs.io/>`__
26+
* - `Highcharts Maps <https://maps-docs.highchartspython.com/>`__
2727
- `Highcharts Maps (JS) <https://www.highcharts.com/products/maps/>`__
2828
- the rich map visualization extension to Highcharts Core
29-
* - `Highcharts Gantt <https://highcharts-gantt.readthedocs.io/>`__
29+
* - `Highcharts Gantt <https://gantt-docs.highchartspython.com/>`__
3030
- `Highcharts Gantt (JS) <https://www.highcharts.com/products/gantt/>`__
3131
- the Gantt charting extension to Highcharts Core
3232
* - (all libraries in the Python toolkit)

docs/errors.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,30 @@ HighchartsCSVDeserializationError (from :class:`ValueError <python:ValueError>`)
134134

135135
--------------
136136

137+
HighchartsPandasDeserializationError (from :class:`ValueError <python:ValueError>`)
138+
==========================================================================================
139+
140+
.. autoexception:: HighchartsPandasDeserializationError
141+
142+
.. collapse:: Class Inheritance
143+
144+
.. inheritance-diagram:: HighchartsPandasDeserializationError
145+
:parts: -1
146+
147+
--------------
148+
149+
HighchartsPySparkDeserializationError (from :class:`ValueError <python:ValueError>`)
150+
==========================================================================================
151+
152+
.. autoexception:: HighchartsPySparkDeserializationError
153+
154+
.. collapse:: Class Inheritance
155+
156+
.. inheritance-diagram:: HighchartsPySparkDeserializationError
157+
:parts: -1
158+
159+
--------------
160+
137161
HighchartsMissingKeyError (from :class:`ValueError <python:ValueError>`)
138162
==========================================================================================
139163

docs/toolkit.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ The **Highcharts for Python** toolkit includes two categories of tools:
3030
`Highcharts Stock <https://www.highcharts.com/products/stock>`__
3131
JavaScript library, which provides extensive visualizations for time series and
3232
stock price visualizations. For more details, please see the relevant
33-
`Highcharts Stock for Python documentation <https://highcharts-stock.readthedocs.io>`__
33+
`Highcharts Stock for Python documentation <https://stock-docs.highchartspython.com>`__
3434
* **Highcharts Maps for Python**: This is the Python wrapper for the
3535
`Highcharts Maps <https://www.highcharts.com/products/maps>`__
3636
JavaScript library, which provides extensive geographic data visualization options
3737
with rich interactive maps. For more details, please see the relevant
38-
`Highcharts Maps for Python documentation <https://highcharts-maps.readthedocs.io>`__
38+
`Highcharts Maps for Python documentation <https://maps-docs.highchartspython.com>`__
3939
* **Highcharts Gantt for Python**: This is the Python wrapper for the
4040
`Highcharts Gantt <https://www.highcharts.com/products/gantt>`__
4141
JavaScript library, which provides rich visualizations for resource allocation over
4242
time. For more details, please see the relevant
43-
`Highcharts Gantt for Python documentation <https://highcharts-gantt.readthedocs.io>`__
43+
`Highcharts Gantt for Python documentation <https://gantt-docs.highchartspython.com>`__
4444

4545

4646
.. tab:: Extensions

docs/visualizations.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,7 +1222,7 @@ visualizations.
12221222
Only **Highcharts Stock for Python** and
12231223
`Highcharts Stock <https://www.highcharts.com/products/stock/>`__ support
12241224
technical indicators. For more information, please see
1225-
`here <https://highcharts-stock.readthedocs.io/>`__.
1225+
`here <https://stock-docs.highchartspython.com/>`__.
12261226

12271227
.. tab:: Gantt
12281228

@@ -1235,4 +1235,4 @@ visualizations.
12351235
Only **Highcharts Stock for Python** and
12361236
`Highcharts Stock <https://www.highcharts.com/products/stock/>`__ support
12371237
technical indicators. For more information, please see
1238-
`here <https://highcharts-stock.readthedocs.io/>`__.
1238+
`here <https://stock-docs.highchartspython.com/>`__.

highcharts_core/__version__.py

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

highcharts_core/errors.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ class HighchartsCSVDeserializationError(HighchartsError):
5656
pass
5757

5858

59+
class HighchartsPandasDeserializationError(HighchartsError):
60+
""":exc:`ValueError <python:ValueError>` encountered when Highcharts for Python is
61+
unable to properly deserialize Pandas data."""
62+
pass
63+
64+
65+
class HighchartsPySparkDeserializationError(HighchartsError):
66+
""":exc:`ValueError <python:ValueError>` encountered when Highcharts for Python is
67+
unable to properly deserialize PySpark data."""
68+
pass
69+
70+
5971
class HighchartsMissingKeyError(HighchartsParseError):
6072
""":exc:`ValueError <python:ValueError>` encountered when Highcharts for Python
6173
encounters a missing key when parsing a JavaScript object literal."""

highcharts_core/headless_export.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,6 @@ def url(self, value):
248248
else:
249249
original_value = value
250250
self.protocol = value[:value.index(':')]
251-
print(f'Found Protocol: {self.protocol}')
252251

253252
protocol = self.protocol + '://'
254253
value = value.replace(protocol, '')
@@ -265,8 +264,6 @@ def url(self, value):
265264
except ValueError:
266265
self.domain = value
267266

268-
print(f'Found Domain: {self.domain}')
269-
270267
domain = self.domain + '/'
271268
if domain in value:
272269
value = value.replace(domain, '')
@@ -302,9 +299,6 @@ def url(self, value):
302299
else:
303300
self.path = None
304301

305-
print(f'Found Port: {self.port}')
306-
print(f'Found Path: {self.path}')
307-
308302
self._url = original_value
309303

310304
@property

highcharts_core/options/series/base.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,9 @@ def load_from_pandas(self,
696696
raise errors.HighchartsValueError(f'df is expected to be a pandas DataFrame '
697697
f'or Series. Was: {df.__class__.__name__}')
698698

699+
if not property_map:
700+
raise errors.HighchartsValueError('property_map cannot be None or empty')
701+
699702
property_map = validators.dict(property_map)
700703
for key in property_map:
701704
map_value = property_map[key]
@@ -712,9 +715,9 @@ def load_from_pandas(self,
712715
record_as_dict = {}
713716
for key in property_map:
714717
map_value = property_map[key]
715-
record_as_dict[key] = record_as_dict.get(map_value, None)
718+
record_as_dict[key] = record.get(map_value, None)
716719
records_as_dicts.append(record_as_dict)
717-
720+
718721
self.data = records_as_dicts
719722

720723
@classmethod
@@ -824,7 +827,7 @@ def load_from_pyspark(self,
824827
record_as_dict = {}
825828
for key in property_map:
826829
map_value = property_map[key]
827-
record_as_dict[key] = record_as_dict.get(map_value, None)
830+
record_as_dict[key] = record.get(map_value, None)
828831
records_as_dicts.append(record_as_dict)
829832

830833
self.data = records_as_dicts

0 commit comments

Comments
 (0)