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

Fix USA's state geojson for 'Country Map' visualization #4121

Merged
merged 3 commits into from Jan 3, 2018
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
206,471 changes: 206,415 additions & 56 deletions superset/assets/visualizations/countries/usa.geojson

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions superset/connectors/druid/views.py
Expand Up @@ -185,7 +185,8 @@ def _delete(self, pk):
icon='fa-cubes',
category='Sources',
category_label=__('Sources'),
category_icon='fa-database',)
category_icon='fa-database',
)


class DruidDatasourceModelView(DatasourceModelView, DeleteMixin, YamlExportMixin): # noqa
Expand Down Expand Up @@ -348,4 +349,4 @@ def scan_new_datasources(self):
icon='fa-cog')


appbuilder.add_separator('Sources', )
appbuilder.add_separator('Sources')
3 changes: 1 addition & 2 deletions superset/connectors/sqla/models.py
Expand Up @@ -349,8 +349,7 @@ def values_for_column(self, column_name, limit=10000):

engine = self.database.get_sqla_engine()
sql = '{}'.format(
qry.compile(
engine, compile_kwargs={'literal_binds': True}, ),
qry.compile(engine, compile_kwargs={'literal_binds': True}),
)

df = pd.read_sql_query(sql=sql, con=engine)
Expand Down
3 changes: 2 additions & 1 deletion superset/connectors/sqla/views.py
Expand Up @@ -294,6 +294,7 @@ def refresh(self, tables):
label=__('Tables'),
category='Sources',
category_label=__('Sources'),
icon='fa-table',)
icon='fa-table',
)

appbuilder.add_separator('Sources')
2 changes: 1 addition & 1 deletion superset/sql_lab.py
Expand Up @@ -240,7 +240,7 @@ def handle_error(msg):
limit=query.limit,
schema=database.force_ctas_schema,
show_cols=False,
latest_partition=False, ))
latest_partition=False))
query.end_time = utils.now_as_float()
session.merge(query)
session.flush()
Expand Down
14 changes: 7 additions & 7 deletions superset/views/core.py
Expand Up @@ -187,7 +187,7 @@ class DatabaseView(SupersetModelView, DeleteMixin, YamlExportMixin): # noqa
'allow_ctas', 'allow_dml', 'force_ctas_schema', 'impersonate_user']
search_exclude_columns = (
'password', 'tables', 'created_by', 'changed_by', 'queries',
'saved_queries', )
'saved_queries')
edit_columns = add_columns
show_columns = [
'tables',
Expand Down Expand Up @@ -281,7 +281,7 @@ def _delete(self, pk):
icon='fa-cloud-upload',
category='Manage',
category_label=__('Manage'),
category_icon='fa-wrench',)
category_icon='fa-wrench')


appbuilder.add_view(
Expand All @@ -291,7 +291,7 @@ def _delete(self, pk):
icon='fa-database',
category='Sources',
category_label=__('Sources'),
category_icon='fa-database',)
category_icon='fa-database')


class DatabaseAsync(DatabaseView):
Expand Down Expand Up @@ -400,7 +400,7 @@ class AccessRequestsModelView(SupersetModelView, DeleteMixin):
label=__('Access requests'),
category='Security',
category_label=__('Security'),
icon='fa-table',)
icon='fa-table')


class SliceModelView(SupersetModelView, DeleteMixin): # noqa
Expand Down Expand Up @@ -488,7 +488,7 @@ def add(self):
label=__('Charts'),
icon='fa-bar-chart',
category='',
category_icon='',)
category_icon='')


class SliceAsync(SliceModelView): # noqa
Expand Down Expand Up @@ -615,7 +615,7 @@ def download_dashboards(self):
label=__('Dashboards'),
icon='fa-dashboard',
category='',
category_icon='',)
category_icon='')


class DashboardModelViewAsync(DashboardModelView): # noqa
Expand Down Expand Up @@ -2594,7 +2594,7 @@ class CssTemplateAsyncModelView(CssTemplateModelView):
icon='fa-upload',
category='Sources',
category_label=__('Sources'),
category_icon='fa-wrench',)
category_icon='fa-wrench')
appbuilder.add_separator('Sources')


Expand Down
12 changes: 7 additions & 5 deletions tests/core_tests.py
Expand Up @@ -833,18 +833,20 @@ def test_import_csv(self):

def test_dataframe_timezone(self):
tz = psycopg2.tz.FixedOffsetTimezone(offset=60, name=None)
data = [(datetime.datetime(2017, 11, 18, 21, 53, 0, 219225, tzinfo=tz),),
(datetime.datetime(2017, 11, 18, 22, 6, 30, 61810, tzinfo=tz,),)]
data = [
(datetime.datetime(2017, 11, 18, 21, 53, 0, 219225, tzinfo=tz),),
(datetime.datetime(2017, 11, 18, 22, 6, 30, 61810, tzinfo=tz),),
]
df = dataframe.SupersetDataFrame(pd.DataFrame(data=list(data),
columns=['data', ]))
columns=['data']))
data = df.data
self.assertDictEqual(
data[0],
{'data': pd.Timestamp('2017-11-18 21:53:00.219225+0100', tz=tz), },
{'data': pd.Timestamp('2017-11-18 21:53:00.219225+0100', tz=tz)},
)
self.assertDictEqual(
data[1],
{'data': pd.Timestamp('2017-11-18 22:06:30.061810+0100', tz=tz), },
{'data': pd.Timestamp('2017-11-18 22:06:30.061810+0100', tz=tz)},
)


Expand Down