Skip to content
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
8 changes: 8 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
Release 1.0.0-rc2
=========================================

* Closed #18. Fixed bug where loading data from a Pandas Dataframe could produce data points with None values.
* Added ``HighchartsPandasDeserializationError`` and ``HighchartsPySparkDeserializationError``.

---------------

Release 1.0.0-rc1
=========================================

Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ The toolkit is composed of several different libraries, each of which provides c
* - **Highcharts Core for Python**
- `Highcharts Core (JS) <https://www.highcharts.com/products/highcharts/>`__
- (this library) the core Highcharts data visualization library
* - `Highcharts Stock for Python <https://highcharts-stock.readthedocs.io/>`__
* - `Highcharts Stock for Python <https://stock-docs.highchartspython.com/>`__
- `Highcharts Stock (JS) <https://www.highcharts.com/products/stock/>`__
- the robust time series visualization extension to Highcharts Core
* - `Highcharts Maps <https://highcharts-maps.readthedocs.io/>`__
* - `Highcharts Maps <https://maps-docs.highchartspython.com/>`__
- `Highcharts Maps (JS) <https://www.highcharts.com/products/maps/>`__
- the rich map visualization extension to Highcharts Core
* - `Highcharts Gantt <https://highcharts-gantt.readthedocs.io/>`__
* - `Highcharts Gantt <https://gantt-docs.highchartspython.com/>`__
- `Highcharts Gantt (JS) <https://www.highcharts.com/products/gantt/>`__
- the Gantt charting extension to Highcharts Core
* - (all libraries in the Python toolkit)
Expand Down
24 changes: 24 additions & 0 deletions docs/errors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,30 @@ HighchartsCSVDeserializationError (from :class:`ValueError <python:ValueError>`)

--------------

HighchartsPandasDeserializationError (from :class:`ValueError <python:ValueError>`)
==========================================================================================

.. autoexception:: HighchartsPandasDeserializationError

.. collapse:: Class Inheritance

.. inheritance-diagram:: HighchartsPandasDeserializationError
:parts: -1

--------------

HighchartsPySparkDeserializationError (from :class:`ValueError <python:ValueError>`)
==========================================================================================

.. autoexception:: HighchartsPySparkDeserializationError

.. collapse:: Class Inheritance

.. inheritance-diagram:: HighchartsPySparkDeserializationError
:parts: -1

--------------

HighchartsMissingKeyError (from :class:`ValueError <python:ValueError>`)
==========================================================================================

Expand Down
6 changes: 3 additions & 3 deletions docs/toolkit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ The **Highcharts for Python** toolkit includes two categories of tools:
`Highcharts Stock <https://www.highcharts.com/products/stock>`__
JavaScript library, which provides extensive visualizations for time series and
stock price visualizations. For more details, please see the relevant
`Highcharts Stock for Python documentation <https://highcharts-stock.readthedocs.io>`__
`Highcharts Stock for Python documentation <https://stock-docs.highchartspython.com>`__
* **Highcharts Maps for Python**: This is the Python wrapper for the
`Highcharts Maps <https://www.highcharts.com/products/maps>`__
JavaScript library, which provides extensive geographic data visualization options
with rich interactive maps. For more details, please see the relevant
`Highcharts Maps for Python documentation <https://highcharts-maps.readthedocs.io>`__
`Highcharts Maps for Python documentation <https://maps-docs.highchartspython.com>`__
* **Highcharts Gantt for Python**: This is the Python wrapper for the
`Highcharts Gantt <https://www.highcharts.com/products/gantt>`__
JavaScript library, which provides rich visualizations for resource allocation over
time. For more details, please see the relevant
`Highcharts Gantt for Python documentation <https://highcharts-gantt.readthedocs.io>`__
`Highcharts Gantt for Python documentation <https://gantt-docs.highchartspython.com>`__


.. tab:: Extensions
Expand Down
4 changes: 2 additions & 2 deletions docs/visualizations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ visualizations.
Only **Highcharts Stock for Python** and
`Highcharts Stock <https://www.highcharts.com/products/stock/>`__ support
technical indicators. For more information, please see
`here <https://highcharts-stock.readthedocs.io/>`__.
`here <https://stock-docs.highchartspython.com/>`__.

.. tab:: Gantt

Expand All @@ -1235,4 +1235,4 @@ visualizations.
Only **Highcharts Stock for Python** and
`Highcharts Stock <https://www.highcharts.com/products/stock/>`__ support
technical indicators. For more information, please see
`here <https://highcharts-stock.readthedocs.io/>`__.
`here <https://stock-docs.highchartspython.com/>`__.
2 changes: 1 addition & 1 deletion highcharts_core/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.0.0-rc1'
__version__ = '1.0.0-rc2'
12 changes: 12 additions & 0 deletions highcharts_core/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ class HighchartsCSVDeserializationError(HighchartsError):
pass


class HighchartsPandasDeserializationError(HighchartsError):
""":exc:`ValueError <python:ValueError>` encountered when Highcharts for Python is
unable to properly deserialize Pandas data."""
pass


class HighchartsPySparkDeserializationError(HighchartsError):
""":exc:`ValueError <python:ValueError>` encountered when Highcharts for Python is
unable to properly deserialize PySpark data."""
pass


class HighchartsMissingKeyError(HighchartsParseError):
""":exc:`ValueError <python:ValueError>` encountered when Highcharts for Python
encounters a missing key when parsing a JavaScript object literal."""
Expand Down
6 changes: 0 additions & 6 deletions highcharts_core/headless_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ def url(self, value):
else:
original_value = value
self.protocol = value[:value.index(':')]
print(f'Found Protocol: {self.protocol}')

protocol = self.protocol + '://'
value = value.replace(protocol, '')
Expand All @@ -265,8 +264,6 @@ def url(self, value):
except ValueError:
self.domain = value

print(f'Found Domain: {self.domain}')

domain = self.domain + '/'
if domain in value:
value = value.replace(domain, '')
Expand Down Expand Up @@ -302,9 +299,6 @@ def url(self, value):
else:
self.path = None

print(f'Found Port: {self.port}')
print(f'Found Path: {self.path}')

self._url = original_value

@property
Expand Down
9 changes: 6 additions & 3 deletions highcharts_core/options/series/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,9 @@ def load_from_pandas(self,
raise errors.HighchartsValueError(f'df is expected to be a pandas DataFrame '
f'or Series. Was: {df.__class__.__name__}')

if not property_map:
raise errors.HighchartsValueError('property_map cannot be None or empty')

property_map = validators.dict(property_map)
for key in property_map:
map_value = property_map[key]
Expand All @@ -712,9 +715,9 @@ def load_from_pandas(self,
record_as_dict = {}
for key in property_map:
map_value = property_map[key]
record_as_dict[key] = record_as_dict.get(map_value, None)
record_as_dict[key] = record.get(map_value, None)
records_as_dicts.append(record_as_dict)

self.data = records_as_dicts

@classmethod
Expand Down Expand Up @@ -824,7 +827,7 @@ def load_from_pyspark(self,
record_as_dict = {}
for key in property_map:
map_value = property_map[key]
record_as_dict[key] = record_as_dict.get(map_value, None)
record_as_dict[key] = record.get(map_value, None)
records_as_dicts.append(record_as_dict)

self.data = records_as_dicts
Expand Down
Loading