Skip to content

Commit

Permalink
added timestamp import to matplotlib linecharts (#396) (#397)
Browse files Browse the repository at this point in the history
* added timestamp import

* fix broken test

* version lock to pandas version < 1.3
  • Loading branch information
dorisjlee committed Jul 5, 2021
1 parent 17dd0ee commit 0d934dd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ jobs:
pip install -r requirements-dev.txt
pip install sqlalchemy
pip uninstall -y lux-widget
pip install git+git://github.com/lux-org/lux-widget.git
# Temporary Fix (#372)
cd /opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/luxwidget/
mkdir labextension
cd labextension
wget https://raw.githubusercontent.com/lux-org/lux-widget/master/luxwidget/nbextension/package.json
# pip uninstall -y lux-widget
# pip install git+git://github.com/lux-org/lux-widget.git
# # Temporary Fix (#372)
# cd /opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/luxwidget/
# mkdir labextension
# cd labextension
# wget https://raw.githubusercontent.com/lux-org/lux-widget/master/luxwidget/nbextension/package.json
- name: Upload data to Postgres
run: |
Expand Down
1 change: 1 addition & 0 deletions lux/vislib/matplotlib/LineChart.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def initialize_chart(self):

self.code += "import numpy as np\n"
self.code += "from math import nan\n"
self.code += "from pandas import Timestamp\n"
self.code += f"df = pd.DataFrame({str(self.data.to_dict())})\n"
self.code += f"fig, ax = plt.subplots()\n"
self.code += f"x_pts = df['{x_attr.attribute}']\n"
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
scipy>=1.3.3
altair>=4.0.0
numpy>=1.16.5
pandas>=1.2.0
pandas>=1.2.0,<1.3.0
scikit-learn>=0.22
matplotlib>=3.0.0
lux-widget>=0.1.4
iso3166
iso3166

0 comments on commit 0d934dd

Please sign in to comment.