You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/10/16 18:46:37 UTC
[GitHub] [incubator-superset] kkucharc opened a new pull request #11308: tests: added fixture with energy usage instead of example
kkucharc opened a new pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308
All tests which requires data from energy usages will be loaded and cleaned up after each test thanks to fixture.
### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
<!--- Skip this if not applicable -->
### TEST PLAN
<!--- What steps should be taken to verify the changes -->
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] Changes UI
- [ ] Requires DB Migration.
- [ ] Confirm DB Migration upgrade and downgrade tested.
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#issuecomment-710466005
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=h1) Report
> Merging [#11308](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=desc) (1cb24e3) into [master](https://codecov.io/gh/apache/incubator-superset/commit/0396c705d4b3d886618c664aa339178bfb188066?el=desc) (0396c70) will **decrease** coverage by `13.34%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/11308/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #11308 +/- ##
===========================================
- Coverage 67.61% 54.27% -13.35%
===========================================
Files 928 420 -508
Lines 45073 14802 -30271
Branches 4314 3816 -498
===========================================
- Hits 30477 8034 -22443
+ Misses 14493 6768 -7725
+ Partials 103 0 -103
```
| Flag | Coverage Δ | |
|---|---|---|
| cypress | `54.27% <ø> (-0.67%)` | :arrow_down: |
| javascript | `?` | |
| python | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...uperset-frontend/src/dashboard/util/dnd-reorder.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2RuZC1yZW9yZGVyLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...rset-frontend/src/dashboard/util/getEmptyLayout.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEVtcHR5TGF5b3V0Lmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...dashboard/components/resizable/ResizableHandle.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL3Jlc2l6YWJsZS9SZXNpemFibGVIYW5kbGUuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [.../src/dashboard/util/getFilterScopeFromNodesTree.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEZpbHRlclNjb3BlRnJvbU5vZGVzVHJlZS5qcw==) | `0.00% <0.00%> (-93.48%)` | :arrow_down: |
| [...src/dashboard/components/gridComponents/Header.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0hlYWRlci5qc3g=) | `10.52% <0.00%> (-86.85%)` | :arrow_down: |
| [...rc/dashboard/components/gridComponents/Divider.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0RpdmlkZXIuanN4) | `13.33% <0.00%> (-86.67%)` | :arrow_down: |
| [...ontend/src/dashboard/util/getDashboardFilterKey.ts](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldERhc2hib2FyZEZpbHRlcktleS50cw==) | `14.28% <0.00%> (-85.72%)` | :arrow_down: |
| [...nd/src/views/CRUD/data/query/QueryPreviewModal.tsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvZGF0YS9xdWVyeS9RdWVyeVByZXZpZXdNb2RhbC50c3g=) | `14.70% <0.00%> (-82.97%)` | :arrow_down: |
| [...set-frontend/src/views/CRUD/welcome/EmptyState.tsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9FbXB0eVN0YXRlLnRzeA==) | `5.71% <0.00%> (-82.10%)` | :arrow_down: |
| [...et-frontend/src/SqlLab/components/TableElement.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1RhYmxlRWxlbWVudC5qc3g=) | `4.70% <0.00%> (-81.35%)` | :arrow_down: |
| ... and [777 more](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=footer). Last update [0396c70...7ca7dc9](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#issuecomment-710466005
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=h1) Report
> Merging [#11308](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=desc) (7ca7dc9) into [master](https://codecov.io/gh/apache/incubator-superset/commit/0396c705d4b3d886618c664aa339178bfb188066?el=desc) (0396c70) will **decrease** coverage by `3.92%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/11308/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #11308 +/- ##
==========================================
- Coverage 67.61% 63.69% -3.93%
==========================================
Files 928 928
Lines 45073 45065 -8
Branches 4314 4314
==========================================
- Hits 30477 28702 -1775
- Misses 14493 16186 +1693
- Partials 103 177 +74
```
| Flag | Coverage Δ | |
|---|---|---|
| cypress | `?` | |
| javascript | `63.15% <ø> (ø)` | |
| python | `64.00% <ø> (-0.11%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset-frontend/src/SqlLab/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9BcHAuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvQXBwLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/dashboard/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9BcHAuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/index.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvaW5kZXguanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/dashboard/index.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9pbmRleC5qc3g=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/setup/setupColors.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwQ29sb3JzLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/chart/ChartContainer.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0Q29udGFpbmVyLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/reducers/index.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvaW5kZXguanM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...et-frontend/src/dashboard/containers/Dashboard.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb250YWluZXJzL0Rhc2hib2FyZC5qc3g=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...t-frontend/src/dashboard/containers/SliceAdder.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb250YWluZXJzL1NsaWNlQWRkZXIuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| ... and [167 more](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=footer). Last update [0396c70...7ca7dc9](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] villebro commented on a change in pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#discussion_r509033536
##########
File path: tests/db_engine_specs/base_engine_spec_tests.py
##########
@@ -14,19 +14,22 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-from tests.test_app import app # isort:skip
-
import datetime
from unittest import mock
+import pytest
+
from superset.db_engine_specs import engines
from superset.db_engine_specs.base import BaseEngineSpec, builtin_time_grains
from superset.db_engine_specs.sqlite import SqliteEngineSpec
from superset.utils.core import get_example_database
from tests.db_engine_specs.base_tests import TestDbEngineSpec
+from ..fixtures.energy_dashboard import load_energy_table_with_slice
from ..fixtures.pyodbcRow import Row
+from tests.test_app import app # isort:skip
+
Review comment:
I wonder if this needs to higher up on the imports? (this is usually the case)
##########
File path: tests/charts/api_tests.py
##########
@@ -691,7 +694,7 @@ def test_get_charts_custom_filter(self):
self.assertEqual(item["slice_name"], expected_response[index]["slice_name"])
self.assertEqual(item["viz_type"], expected_response[index]["viz_type"])
- @pytest.mark.usefixtures("load_charts")
+ @pytest.mark.usefixtures("load_energy_table_with_slice", "load_charts")
Review comment:
Should we rename `load_charts` to `load_energy_charts`?
##########
File path: tests/fixtures/energy_dashboard.py
##########
@@ -0,0 +1,357 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import random
+import textwrap
+from typing import Dict, Set
+
+import pandas as pd
+import pytest
+from pandas import DataFrame
+from sqlalchemy import column, Float, String
+
+from superset import db
+from superset.connectors.sqla.models import SqlaTable, SqlMetric
+from superset.models.dashboard import Dashboard
+from superset.models.slice import Slice
+from superset.utils.core import get_example_database
+from tests.dashboard_utils import create_slice, create_table_for_dashboard
+from tests.test_app import app
+
+misc_dash_slices: Set[str] = set()
+
+
+@pytest.fixture()
+def load_energy_table_with_slice():
+ table_name = "energy_usage"
+ df = _get_dataframe()
+ with app.app_context():
+ yield _create_energy_table(df, table_name)
+ _cleanup()
+
+
+def _get_dataframe():
+ data = _get_energy_data()
+ return pd.DataFrame.from_dict(data)
+
+
+def _create_energy_table(df: DataFrame, table_name: str):
+ database = get_example_database()
+
+ table_description = "Energy consumption"
+ schema = {"source": String(255), "target": String(255), "value": Float()}
+ table = create_table_for_dashboard(
+ df, table_name, database, schema, table_description
+ )
+ table.fetch_metadata()
+
+ if not any(col.metric_name == "sum__value" for col in table.metrics):
+ col = str(column("value").compile(db.engine))
+ table.metrics.append(
+ SqlMetric(metric_name="sum__value", expression=f"SUM({col})")
+ )
+
+ db.session.merge(table)
+ db.session.commit()
+ table.fetch_metadata()
+
+ for slice_data in _get_energy_slices():
+ _create_and_commit_energy_slice(
+ table,
+ slice_data["slice_title"],
+ slice_data["viz_type"],
+ slice_data["params"],
+ )
+
+
+def _create_and_commit_energy_slice(
+ table: SqlaTable, title: str, viz_type: str, param: Dict[str, str]
+):
+ slice = create_slice(title, viz_type, table, param)
+ existing_slice = (
+ db.session.query(Slice).filter_by(slice_name=slice.slice_name).first()
+ )
+ if existing_slice:
+ db.session.delete(existing_slice)
+ db.session.add(slice)
+ db.session.commit()
+ return slice
+
+
+def _cleanup() -> None:
+ engine = get_example_database().get_sqla_engine()
+ engine.execute("DROP TABLE IF EXISTS energy_usage")
+ for slice_data in _get_energy_slices():
+ slice = (
+ db.session.query(Slice)
+ .filter_by(slice_name=slice_data["slice_title"])
+ .first()
+ )
+ db.session.delete(slice)
+
+ metric = (
+ db.session.query(SqlMetric).filter_by(metric_name="sum__value").one_or_none()
+ )
+ if metric:
+ db.session.delete(metric)
+
+ db.session.commit()
+
+
+def _get_energy_data():
+ return [
+ {
+ "source": "Agricultural Energy Use",
+ "target": "Carbon Dioxide",
+ "value": "1.4",
+ },
+ {"source": "Agriculture", "target": "Agriculture Soils", "value": "5.2"},
+ {"source": "Agriculture", "target": "Livestock and Manure", "value": "5.4"},
+ {"source": "Agriculture", "target": "Other Agriculture", "value": "1.7"},
+ {"source": "Agriculture", "target": "Rice Cultivation", "value": "1.5"},
+ {"source": "Agriculture Soils", "target": "Nitrous Oxide", "value": "5.2"},
+ {"source": "s", "target": "Carbon Dioxide", "value": "1.7"},
+ {
+ "source": "Aluminium Non-Ferrous Metals",
+ "target": "Carbon Dioxide",
+ "value": "1.0",
+ },
+ {
+ "source": "Aluminium Non-Ferrous Metals",
+ "target": "HFCs - PFCs",
+ "value": "0.2",
+ },
+ {"source": "Cement", "target": "Carbon Dioxide", "value": "5.0"},
+ {"source": "Chemicals", "target": "Carbon Dioxide", "value": "3.4"},
+ {"source": "Chemicals", "target": "HFCs - PFCs", "value": "0.5"},
+ {"source": "Chemicals", "target": "Nitrous Oxide", "value": "0.2"},
+ {"source": "Coal Mining", "target": "Carbon Dioxide", "value": "0.1"},
+ {"source": "Coal Mining", "target": "Methane", "value": "1.2"},
+ {"source": "Commercial Buildings", "target": "Carbon Dioxide", "value": "6.3"},
+ {"source": "Deforestation", "target": "Carbon Dioxide", "value": "10.9"},
+ {
+ "source": "Electricity,heat",
+ "target": "Agricultural Energy Use",
+ "value": "0.4",
+ },
+ {
+ "source": "Electricity and heat",
+ "target": "Aluminium Non-Ferrous Metals",
+ "value": "0.4",
+ },
+ {"source": "Electricity and heat", "target": "Cement", "value": "0.3"},
+ {"source": "Electricity and heat", "target": "Chemicals", "value": "1.3"},
+ {
+ "source": "Electricity and heat",
+ "target": "Commercial Buildings",
+ "value": "5.0",
+ },
+ {
+ "source": "Electricity and heat",
+ "target": "Food and Tobacco",
+ "value": "0.5",
+ },
+ {"source": "Electricity and heat", "target": "Iron and Steel", "value": "1.0"},
+ {"source": "Electricity and heat", "target": "Machinery", "value": "1.0"},
+ {
+ "source": "Electricity and heat",
+ "target": "Oil and Gas Processing",
+ "value": "0.4",
+ },
+ {"source": "Electricity and heat", "target": "Other Industry", "value": "2.7"},
+ {
+ "source": "Electricity and heat",
+ "target": "Pulp - Paper and Printing",
+ "value": "0.6",
+ },
+ {
+ "source": "Electricity and heat",
+ "target": "Residential Buildings",
+ "value": "5.2",
+ },
+ {"source": "Electricity and heat", "target": "T and D Losses", "value": "2.2"},
+ {
+ "source": "Electricity and heat",
+ "target": "Unallocated Fuel Combustion",
+ "value": "2.0",
+ },
+ {"source": "Energy", "target": "Electricity and heat", "value": "24.9"},
+ {"source": "Energy", "target": "Fugitive Emissions", "value": "4.0"},
+ {"source": "Energy", "target": "Industry", "value": "14.7"},
+ {"source": "Energy", "target": "Other Fuel Combustion", "value": "8.6"},
+ {"source": "Energy", "target": "Transportation", "value": "14.3"},
+ {"source": "Food and Tobacco", "target": "Carbon Dioxide", "value": "1.0"},
+ {"source": "Fugitive Emissions", "target": "Coal Mining", "value": "1.3"},
+ {
+ "source": "Fugitive Emissions",
+ "target": "Oil and Gas Processing",
+ "value": "3.2",
+ },
+ {"source": "Harvest \/ Management", "target": "Carbon Dioxide", "value": "1.3"},
+ {
+ "source": "Industrial Processes",
+ "target": "Aluminium Non-Ferrous Metals",
+ "value": "0.4",
+ },
+ {"source": "Industrial Processes", "target": "Cement", "value": "2.8"},
+ {"source": "Industrial Processes", "target": "Chemicals", "value": "1.4"},
+ {"source": "Industrial Processes", "target": "Other Industry", "value": "0.5"},
+ {
+ "source": "Industry",
+ "target": "Aluminium Non-Ferrous Metals",
+ "value": "0.4",
+ },
+ {"source": "Industry", "target": "Cement", "value": "1.9"},
+ {"source": "Industry", "target": "Chemicals", "value": "1.4"},
+ {"source": "Industry", "target": "Food and Tobacco", "value": "0.5"},
+ {"source": "Industry", "target": "Iron and Steel", "value": "3.0"},
+ {"source": "Industry", "target": "Oil and Gas Processing", "value": "2.8"},
+ {"source": "Industry", "target": "Other Industry", "value": "3.8"},
+ {"source": "Industry", "target": "Pulp - Paper and Printing", "value": "0.5"},
+ {"source": "Iron and Steel", "target": "Carbon Dioxide", "value": "4.0"},
+ {"source": "Land Use Change", "target": "Deforestation", "value": "10.9"},
+ {
+ "source": "Land Use Change",
+ "target": "Harvest \/ Management",
+ "value": "1.3",
+ },
+ {"source": "Landfills", "target": "Methane", "value": "1.7"},
+ {"source": "Livestock and Manure", "target": "Methane", "value": "5.1"},
+ {"source": "Livestock and Manure", "target": "Nitrous Oxide", "value": "0.3"},
+ {"source": "Machinery", "target": "Carbon Dioxide", "value": "1.0"},
+ {
+ "source": "Oil and Gas Processing",
+ "target": "Carbon Dioxide",
+ "value": "3.6",
+ },
+ {"source": "Oil and Gas Processing", "target": "Methane", "value": "2.8"},
+ {"source": "Other Agriculture", "target": "Methane", "value": "1.4"},
+ {"source": "Other Agriculture", "target": "Nitrous Oxide", "value": "0.3"},
+ {
+ "source": "Other Fuel Combustion",
+ "target": "Agricultural Energy Use",
+ "value": "1.0",
+ },
+ {
+ "source": "Other Fuel Combustion",
+ "target": "Commercial Buildings",
+ "value": "1.3",
+ },
+ {
+ "source": "Other Fuel Combustion",
+ "target": "Residential Buildings",
+ "value": "5.0",
+ },
+ {
+ "source": "Other Fuel Combustion",
+ "target": "Unallocated Fuel Combustion",
+ "value": "1.8",
+ },
+ {"source": "Other Industry", "target": "Carbon Dioxide", "value": "6.6"},
+ {"source": "Other Industry", "target": "HFCs - PFCs", "value": "0.4"},
+ {
+ "source": "Pulp - Paper and Printing",
+ "target": "Carbon Dioxide",
+ "value": "1.1",
+ },
+ {
+ "source": "Rail - Ship and Other Transport",
+ "target": "Carbon Dioxide",
+ "value": "2.5",
+ },
+ {
+ "source": "Residential Buildings",
+ "target": "Carbon Dioxide",
+ "value": "10.2",
+ },
+ {"source": "Rice Cultivation", "target": "Methane", "value": "1.5"},
+ {"source": "Road", "target": "Carbon Dioxide", "value": "10.5"},
+ {"source": "T and D Losses", "target": "Carbon Dioxide", "value": "2.2"},
+ {"source": "Transportation", "target": "Air", "value": "1.7"},
+ {
+ "source": "Transportation",
+ "target": "Rail - Ship and Other Transport",
+ "value": "2.5",
+ },
+ {"source": "Transportation", "target": "Road", "value": "10.5"},
+ {
+ "source": "Unallocated Fuel Combustion",
+ "target": "Carbon Dioxide",
+ "value": "3.0",
+ },
+ {"source": "Unallocated Fuel Combustion", "target": "Methane", "value": "0.4"},
+ {
+ "source": "Unallocated Fuel Combustion",
+ "target": "Nitrous Oxide",
+ "value": "0.4",
+ },
+ {"source": "Waste", "target": "Landfills", "value": "1.7"},
+ {"source": "Waste", "target": "Waste water - Other Waste", "value": "1.5"},
+ {"source": "Waste water - Other Waste", "target": "Methane", "value": "1.2"},
+ {
+ "source": "Waste water - Other Waste",
+ "target": "Nitrous Oxide",
+ "value": "0.3",
+ },
+ ]
Review comment:
I wonder if we should utilize the existing data fetching logic from the examples data? See `superset/examples/helpers.py` and `superset/examples/energy.py:load_energy()`. I think we could potentially cache the data on disk, so it only needs to be fetched once if it's already there (I don't expect this data to change that often).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#issuecomment-710466005
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=h1) Report
> Merging [#11308](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=desc) (7ca7dc9) into [master](https://codecov.io/gh/apache/incubator-superset/commit/0396c705d4b3d886618c664aa339178bfb188066?el=desc) (0396c70) will **decrease** coverage by `0.07%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/11308/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #11308 +/- ##
==========================================
- Coverage 63.75% 63.68% -0.08%
==========================================
Files 928 928
Lines 45065 45065
Branches 4314 4314
==========================================
- Hits 28731 28699 -32
- Misses 16157 16189 +32
Partials 177 177
```
| Flag | Coverage Δ | |
|---|---|---|
| javascript | `63.15% <ø> (ø)` | |
| python | `63.99% <ø> (-0.12%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset/examples/energy.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvZW5lcmd5LnB5) | `27.50% <0.00%> (-72.50%)` | :arrow_down: |
| [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.75% <0.00%> (-0.65%)` | :arrow_down: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=footer). Last update [0396c70...7ca7dc9](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#issuecomment-710466005
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=h1) Report
> Merging [#11308](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=desc) (1cb24e3) into [master](https://codecov.io/gh/apache/incubator-superset/commit/0396c705d4b3d886618c664aa339178bfb188066?el=desc) (0396c70) will **decrease** coverage by `12.75%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/11308/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #11308 +/- ##
===========================================
- Coverage 67.61% 54.86% -12.76%
===========================================
Files 928 420 -508
Lines 45073 14802 -30271
Branches 4314 3816 -498
===========================================
- Hits 30477 8121 -22356
+ Misses 14493 6681 -7812
+ Partials 103 0 -103
```
| Flag | Coverage Δ | |
|---|---|---|
| cypress | `54.86% <ø> (-0.09%)` | :arrow_down: |
| javascript | `?` | |
| python | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...uperset-frontend/src/dashboard/util/dnd-reorder.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2RuZC1yZW9yZGVyLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...rset-frontend/src/dashboard/util/getEmptyLayout.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEVtcHR5TGF5b3V0Lmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...dashboard/components/resizable/ResizableHandle.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL3Jlc2l6YWJsZS9SZXNpemFibGVIYW5kbGUuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [.../src/dashboard/util/getFilterScopeFromNodesTree.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEZpbHRlclNjb3BlRnJvbU5vZGVzVHJlZS5qcw==) | `0.00% <0.00%> (-93.48%)` | :arrow_down: |
| [...src/dashboard/components/gridComponents/Header.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0hlYWRlci5qc3g=) | `10.52% <0.00%> (-86.85%)` | :arrow_down: |
| [...rc/dashboard/components/gridComponents/Divider.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0RpdmlkZXIuanN4) | `13.33% <0.00%> (-86.67%)` | :arrow_down: |
| [...ontend/src/dashboard/util/getDashboardFilterKey.ts](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldERhc2hib2FyZEZpbHRlcktleS50cw==) | `14.28% <0.00%> (-85.72%)` | :arrow_down: |
| [...nd/src/views/CRUD/data/query/QueryPreviewModal.tsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvZGF0YS9xdWVyeS9RdWVyeVByZXZpZXdNb2RhbC50c3g=) | `14.70% <0.00%> (-82.97%)` | :arrow_down: |
| [...set-frontend/src/views/CRUD/welcome/EmptyState.tsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9FbXB0eVN0YXRlLnRzeA==) | `5.71% <0.00%> (-82.10%)` | :arrow_down: |
| [...et-frontend/src/SqlLab/components/TableElement.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1RhYmxlRWxlbWVudC5qc3g=) | `4.70% <0.00%> (-81.35%)` | :arrow_down: |
| ... and [776 more](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=footer). Last update [0396c70...7ca7dc9](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#issuecomment-710466005
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=h1) Report
> Merging [#11308](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/73690397139440a509eda74740bfd5ac6ed596db?el=desc) will **decrease** coverage by `4.31%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/11308/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #11308 +/- ##
==========================================
- Coverage 65.75% 61.44% -4.32%
==========================================
Files 838 838
Lines 39714 39711 -3
Branches 3613 3613
==========================================
- Hits 26115 24401 -1714
- Misses 13498 15129 +1631
- Partials 101 181 +80
```
| Flag | Coverage Δ | |
|---|---|---|
| #cypress | `?` | |
| #javascript | `62.60% <ø> (ø)` | |
| #python | `60.75% <ø> (-0.16%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset-frontend/src/SqlLab/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9BcHAuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvQXBwLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/dashboard/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9BcHAuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/index.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvaW5kZXguanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/dashboard/index.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9pbmRleC5qc3g=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/setup/setupColors.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwQ29sb3JzLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/chart/ChartContainer.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0Q29udGFpbmVyLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/setup/setupFormatters.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwRm9ybWF0dGVycy5qcw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/reducers/index.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvaW5kZXguanM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/setup/setupPluginsExtra.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwUGx1Z2luc0V4dHJhLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| ... and [173 more](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=footer). Last update [7369039...3239d40](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] kkucharc closed pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
kkucharc closed pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#issuecomment-710466005
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=h1) Report
> Merging [#11308](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=desc) (7ca7dc9) into [master](https://codecov.io/gh/apache/incubator-superset/commit/0396c705d4b3d886618c664aa339178bfb188066?el=desc) (0396c70) will **decrease** coverage by `0.43%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/11308/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #11308 +/- ##
==========================================
- Coverage 63.75% 63.31% -0.44%
==========================================
Files 928 462 -466
Lines 45065 28432 -16633
Branches 4314 0 -4314
==========================================
- Hits 28731 18002 -10729
+ Misses 16157 10430 -5727
+ Partials 177 0 -177
```
| Flag | Coverage Δ | |
|---|---|---|
| javascript | `?` | |
| python | `63.31% <ø> (-0.79%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset/db\_engines/hive.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
| [superset/examples/energy.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvZW5lcmd5LnB5) | `27.50% <0.00%> (-72.50%)` | :arrow_down: |
| [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `54.61% <0.00%> (-29.62%)` | :arrow_down: |
| [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `69.95% <0.00%> (-12.45%)` | :arrow_down: |
| [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `79.59% <0.00%> (-12.25%)` | :arrow_down: |
| [superset/db\_engine\_specs/sqlite.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3NxbGl0ZS5weQ==) | `65.62% <0.00%> (-9.38%)` | :arrow_down: |
| [superset/utils/celery.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `96.42% <0.00%> (-3.58%)` | :arrow_down: |
| [superset/examples/world\_bank.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvd29ybGRfYmFuay5weQ==) | `97.10% <0.00%> (-2.90%)` | :arrow_down: |
| [superset/examples/birth\_names.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvYmlydGhfbmFtZXMucHk=) | `96.51% <0.00%> (-2.33%)` | :arrow_down: |
| [superset/views/database/mixins.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `80.70% <0.00%> (-1.76%)` | :arrow_down: |
| ... and [471 more](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=footer). Last update [0396c70...7ca7dc9](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] kkucharc commented on a change in pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
kkucharc commented on a change in pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#discussion_r510844069
##########
File path: tests/fixtures/energy_dashboard.py
##########
@@ -0,0 +1,357 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import random
+import textwrap
+from typing import Dict, Set
+
+import pandas as pd
+import pytest
+from pandas import DataFrame
+from sqlalchemy import column, Float, String
+
+from superset import db
+from superset.connectors.sqla.models import SqlaTable, SqlMetric
+from superset.models.dashboard import Dashboard
+from superset.models.slice import Slice
+from superset.utils.core import get_example_database
+from tests.dashboard_utils import create_slice, create_table_for_dashboard
+from tests.test_app import app
+
+misc_dash_slices: Set[str] = set()
+
+
+@pytest.fixture()
+def load_energy_table_with_slice():
+ table_name = "energy_usage"
+ df = _get_dataframe()
+ with app.app_context():
+ yield _create_energy_table(df, table_name)
+ _cleanup()
+
+
+def _get_dataframe():
+ data = _get_energy_data()
+ return pd.DataFrame.from_dict(data)
+
+
+def _create_energy_table(df: DataFrame, table_name: str):
+ database = get_example_database()
+
+ table_description = "Energy consumption"
+ schema = {"source": String(255), "target": String(255), "value": Float()}
+ table = create_table_for_dashboard(
+ df, table_name, database, schema, table_description
+ )
+ table.fetch_metadata()
+
+ if not any(col.metric_name == "sum__value" for col in table.metrics):
+ col = str(column("value").compile(db.engine))
+ table.metrics.append(
+ SqlMetric(metric_name="sum__value", expression=f"SUM({col})")
+ )
+
+ db.session.merge(table)
+ db.session.commit()
+ table.fetch_metadata()
+
+ for slice_data in _get_energy_slices():
+ _create_and_commit_energy_slice(
+ table,
+ slice_data["slice_title"],
+ slice_data["viz_type"],
+ slice_data["params"],
+ )
+
+
+def _create_and_commit_energy_slice(
+ table: SqlaTable, title: str, viz_type: str, param: Dict[str, str]
+):
+ slice = create_slice(title, viz_type, table, param)
+ existing_slice = (
+ db.session.query(Slice).filter_by(slice_name=slice.slice_name).first()
+ )
+ if existing_slice:
+ db.session.delete(existing_slice)
+ db.session.add(slice)
+ db.session.commit()
+ return slice
+
+
+def _cleanup() -> None:
+ engine = get_example_database().get_sqla_engine()
+ engine.execute("DROP TABLE IF EXISTS energy_usage")
+ for slice_data in _get_energy_slices():
+ slice = (
+ db.session.query(Slice)
+ .filter_by(slice_name=slice_data["slice_title"])
+ .first()
+ )
+ db.session.delete(slice)
+
+ metric = (
+ db.session.query(SqlMetric).filter_by(metric_name="sum__value").one_or_none()
+ )
+ if metric:
+ db.session.delete(metric)
+
+ db.session.commit()
+
+
+def _get_energy_data():
+ return [
+ {
+ "source": "Agricultural Energy Use",
+ "target": "Carbon Dioxide",
+ "value": "1.4",
+ },
+ {"source": "Agriculture", "target": "Agriculture Soils", "value": "5.2"},
+ {"source": "Agriculture", "target": "Livestock and Manure", "value": "5.4"},
+ {"source": "Agriculture", "target": "Other Agriculture", "value": "1.7"},
+ {"source": "Agriculture", "target": "Rice Cultivation", "value": "1.5"},
+ {"source": "Agriculture Soils", "target": "Nitrous Oxide", "value": "5.2"},
+ {"source": "s", "target": "Carbon Dioxide", "value": "1.7"},
+ {
+ "source": "Aluminium Non-Ferrous Metals",
+ "target": "Carbon Dioxide",
+ "value": "1.0",
+ },
+ {
+ "source": "Aluminium Non-Ferrous Metals",
+ "target": "HFCs - PFCs",
+ "value": "0.2",
+ },
+ {"source": "Cement", "target": "Carbon Dioxide", "value": "5.0"},
+ {"source": "Chemicals", "target": "Carbon Dioxide", "value": "3.4"},
+ {"source": "Chemicals", "target": "HFCs - PFCs", "value": "0.5"},
+ {"source": "Chemicals", "target": "Nitrous Oxide", "value": "0.2"},
+ {"source": "Coal Mining", "target": "Carbon Dioxide", "value": "0.1"},
+ {"source": "Coal Mining", "target": "Methane", "value": "1.2"},
+ {"source": "Commercial Buildings", "target": "Carbon Dioxide", "value": "6.3"},
+ {"source": "Deforestation", "target": "Carbon Dioxide", "value": "10.9"},
+ {
+ "source": "Electricity,heat",
+ "target": "Agricultural Energy Use",
+ "value": "0.4",
+ },
+ {
+ "source": "Electricity and heat",
+ "target": "Aluminium Non-Ferrous Metals",
+ "value": "0.4",
+ },
+ {"source": "Electricity and heat", "target": "Cement", "value": "0.3"},
+ {"source": "Electricity and heat", "target": "Chemicals", "value": "1.3"},
+ {
+ "source": "Electricity and heat",
+ "target": "Commercial Buildings",
+ "value": "5.0",
+ },
+ {
+ "source": "Electricity and heat",
+ "target": "Food and Tobacco",
+ "value": "0.5",
+ },
+ {"source": "Electricity and heat", "target": "Iron and Steel", "value": "1.0"},
+ {"source": "Electricity and heat", "target": "Machinery", "value": "1.0"},
+ {
+ "source": "Electricity and heat",
+ "target": "Oil and Gas Processing",
+ "value": "0.4",
+ },
+ {"source": "Electricity and heat", "target": "Other Industry", "value": "2.7"},
+ {
+ "source": "Electricity and heat",
+ "target": "Pulp - Paper and Printing",
+ "value": "0.6",
+ },
+ {
+ "source": "Electricity and heat",
+ "target": "Residential Buildings",
+ "value": "5.2",
+ },
+ {"source": "Electricity and heat", "target": "T and D Losses", "value": "2.2"},
+ {
+ "source": "Electricity and heat",
+ "target": "Unallocated Fuel Combustion",
+ "value": "2.0",
+ },
+ {"source": "Energy", "target": "Electricity and heat", "value": "24.9"},
+ {"source": "Energy", "target": "Fugitive Emissions", "value": "4.0"},
+ {"source": "Energy", "target": "Industry", "value": "14.7"},
+ {"source": "Energy", "target": "Other Fuel Combustion", "value": "8.6"},
+ {"source": "Energy", "target": "Transportation", "value": "14.3"},
+ {"source": "Food and Tobacco", "target": "Carbon Dioxide", "value": "1.0"},
+ {"source": "Fugitive Emissions", "target": "Coal Mining", "value": "1.3"},
+ {
+ "source": "Fugitive Emissions",
+ "target": "Oil and Gas Processing",
+ "value": "3.2",
+ },
+ {"source": "Harvest \/ Management", "target": "Carbon Dioxide", "value": "1.3"},
+ {
+ "source": "Industrial Processes",
+ "target": "Aluminium Non-Ferrous Metals",
+ "value": "0.4",
+ },
+ {"source": "Industrial Processes", "target": "Cement", "value": "2.8"},
+ {"source": "Industrial Processes", "target": "Chemicals", "value": "1.4"},
+ {"source": "Industrial Processes", "target": "Other Industry", "value": "0.5"},
+ {
+ "source": "Industry",
+ "target": "Aluminium Non-Ferrous Metals",
+ "value": "0.4",
+ },
+ {"source": "Industry", "target": "Cement", "value": "1.9"},
+ {"source": "Industry", "target": "Chemicals", "value": "1.4"},
+ {"source": "Industry", "target": "Food and Tobacco", "value": "0.5"},
+ {"source": "Industry", "target": "Iron and Steel", "value": "3.0"},
+ {"source": "Industry", "target": "Oil and Gas Processing", "value": "2.8"},
+ {"source": "Industry", "target": "Other Industry", "value": "3.8"},
+ {"source": "Industry", "target": "Pulp - Paper and Printing", "value": "0.5"},
+ {"source": "Iron and Steel", "target": "Carbon Dioxide", "value": "4.0"},
+ {"source": "Land Use Change", "target": "Deforestation", "value": "10.9"},
+ {
+ "source": "Land Use Change",
+ "target": "Harvest \/ Management",
+ "value": "1.3",
+ },
+ {"source": "Landfills", "target": "Methane", "value": "1.7"},
+ {"source": "Livestock and Manure", "target": "Methane", "value": "5.1"},
+ {"source": "Livestock and Manure", "target": "Nitrous Oxide", "value": "0.3"},
+ {"source": "Machinery", "target": "Carbon Dioxide", "value": "1.0"},
+ {
+ "source": "Oil and Gas Processing",
+ "target": "Carbon Dioxide",
+ "value": "3.6",
+ },
+ {"source": "Oil and Gas Processing", "target": "Methane", "value": "2.8"},
+ {"source": "Other Agriculture", "target": "Methane", "value": "1.4"},
+ {"source": "Other Agriculture", "target": "Nitrous Oxide", "value": "0.3"},
+ {
+ "source": "Other Fuel Combustion",
+ "target": "Agricultural Energy Use",
+ "value": "1.0",
+ },
+ {
+ "source": "Other Fuel Combustion",
+ "target": "Commercial Buildings",
+ "value": "1.3",
+ },
+ {
+ "source": "Other Fuel Combustion",
+ "target": "Residential Buildings",
+ "value": "5.0",
+ },
+ {
+ "source": "Other Fuel Combustion",
+ "target": "Unallocated Fuel Combustion",
+ "value": "1.8",
+ },
+ {"source": "Other Industry", "target": "Carbon Dioxide", "value": "6.6"},
+ {"source": "Other Industry", "target": "HFCs - PFCs", "value": "0.4"},
+ {
+ "source": "Pulp - Paper and Printing",
+ "target": "Carbon Dioxide",
+ "value": "1.1",
+ },
+ {
+ "source": "Rail - Ship and Other Transport",
+ "target": "Carbon Dioxide",
+ "value": "2.5",
+ },
+ {
+ "source": "Residential Buildings",
+ "target": "Carbon Dioxide",
+ "value": "10.2",
+ },
+ {"source": "Rice Cultivation", "target": "Methane", "value": "1.5"},
+ {"source": "Road", "target": "Carbon Dioxide", "value": "10.5"},
+ {"source": "T and D Losses", "target": "Carbon Dioxide", "value": "2.2"},
+ {"source": "Transportation", "target": "Air", "value": "1.7"},
+ {
+ "source": "Transportation",
+ "target": "Rail - Ship and Other Transport",
+ "value": "2.5",
+ },
+ {"source": "Transportation", "target": "Road", "value": "10.5"},
+ {
+ "source": "Unallocated Fuel Combustion",
+ "target": "Carbon Dioxide",
+ "value": "3.0",
+ },
+ {"source": "Unallocated Fuel Combustion", "target": "Methane", "value": "0.4"},
+ {
+ "source": "Unallocated Fuel Combustion",
+ "target": "Nitrous Oxide",
+ "value": "0.4",
+ },
+ {"source": "Waste", "target": "Landfills", "value": "1.7"},
+ {"source": "Waste", "target": "Waste water - Other Waste", "value": "1.5"},
+ {"source": "Waste water - Other Waste", "target": "Methane", "value": "1.2"},
+ {
+ "source": "Waste water - Other Waste",
+ "target": "Nitrous Oxide",
+ "value": "0.3",
+ },
+ ]
Review comment:
@villebro to be honest, I imagine as developer who wants write/run tests (especially unit tests), I would like have data that isn't fetched from web - so I don't need internet to just run tests. Actually this is why I didn't use this fetching on purpose. Also if want use fixtures, probably we would like to cleanup after each test. I think it would extend test setup significantly then. But what do you think about just moving it to separate file (as energy_usage.json) or just shortening collection (if it's possible)?
Actually I had an idea to generate this data with some random values of energy sources, targets and values. Apparently it requires some structure (as far as I remember it complained about some cycles). Maybe you know how this data should be structured so I could generate it with loop?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io commented on pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#issuecomment-710466005
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=h1) Report
> Merging [#11308](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/9856f996206840469b10bff9192785b78ac16f91?el=desc) will **decrease** coverage by `7.41%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/11308/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #11308 +/- ##
==========================================
- Coverage 62.71% 55.30% -7.42%
==========================================
Files 441 404 -37
Lines 14721 13410 -1311
Branches 3610 3392 -218
==========================================
- Hits 9233 7417 -1816
- Misses 5307 5803 +496
- Partials 181 190 +9
```
| Flag | Coverage Δ | |
|---|---|---|
| #cypress | `55.30% <ø> (?)` | |
| #javascript | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...uperset-frontend/src/dashboard/util/dnd-reorder.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2RuZC1yZW9yZGVyLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...rset-frontend/src/dashboard/util/getEmptyLayout.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEVtcHR5TGF5b3V0Lmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...rc/dashboard/util/getLayoutComponentFromChartId.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldExheW91dENvbXBvbmVudEZyb21DaGFydElkLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...dashboard/components/resizable/ResizableHandle.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL3Jlc2l6YWJsZS9SZXNpemFibGVIYW5kbGUuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...d/src/views/CRUD/csstemplates/CssTemplatesList.tsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvY3NzdGVtcGxhdGVzL0Nzc1RlbXBsYXRlc0xpc3QudHN4) | `3.57% <0.00%> (-93.73%)` | :arrow_down: |
| [.../src/dashboard/util/getFilterScopeFromNodesTree.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEZpbHRlclNjb3BlRnJvbU5vZGVzVHJlZS5qcw==) | `0.00% <0.00%> (-93.48%)` | :arrow_down: |
| [.../src/dashboard/components/FilterIndicatorGroup.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0ZpbHRlckluZGljYXRvckdyb3VwLmpzeA==) | `11.76% <0.00%> (-88.24%)` | :arrow_down: |
| [...c/explore/components/controls/withVerification.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy93aXRoVmVyaWZpY2F0aW9uLmpzeA==) | `9.09% <0.00%> (-87.88%)` | :arrow_down: |
| [...src/dashboard/components/gridComponents/Header.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0hlYWRlci5qc3g=) | `10.52% <0.00%> (-86.85%)` | :arrow_down: |
| [...rset-frontend/src/profile/components/Favorites.tsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Byb2ZpbGUvY29tcG9uZW50cy9GYXZvcml0ZXMudHN4) | `0.00% <0.00%> (-86.67%)` | :arrow_down: |
| ... and [334 more](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=footer). Last update [9856f99...0ddcae3](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] willbarrett commented on a change in pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
willbarrett commented on a change in pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#discussion_r512172535
##########
File path: tests/fixtures/energy_dashboard.py
##########
@@ -0,0 +1,357 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import random
+import textwrap
+from typing import Dict, Set
+
+import pandas as pd
+import pytest
+from pandas import DataFrame
+from sqlalchemy import column, Float, String
+
+from superset import db
+from superset.connectors.sqla.models import SqlaTable, SqlMetric
+from superset.models.dashboard import Dashboard
+from superset.models.slice import Slice
+from superset.utils.core import get_example_database
+from tests.dashboard_utils import create_slice, create_table_for_dashboard
+from tests.test_app import app
+
+misc_dash_slices: Set[str] = set()
+
+
+@pytest.fixture()
+def load_energy_table_with_slice():
+ table_name = "energy_usage"
+ df = _get_dataframe()
+ with app.app_context():
+ yield _create_energy_table(df, table_name)
+ _cleanup()
+
+
+def _get_dataframe():
+ data = _get_energy_data()
+ return pd.DataFrame.from_dict(data)
+
+
+def _create_energy_table(df: DataFrame, table_name: str):
+ database = get_example_database()
+
+ table_description = "Energy consumption"
+ schema = {"source": String(255), "target": String(255), "value": Float()}
+ table = create_table_for_dashboard(
+ df, table_name, database, schema, table_description
+ )
+ table.fetch_metadata()
+
+ if not any(col.metric_name == "sum__value" for col in table.metrics):
+ col = str(column("value").compile(db.engine))
+ table.metrics.append(
+ SqlMetric(metric_name="sum__value", expression=f"SUM({col})")
+ )
+
+ db.session.merge(table)
+ db.session.commit()
+ table.fetch_metadata()
+
+ for slice_data in _get_energy_slices():
+ _create_and_commit_energy_slice(
+ table,
+ slice_data["slice_title"],
+ slice_data["viz_type"],
+ slice_data["params"],
+ )
+
+
+def _create_and_commit_energy_slice(
+ table: SqlaTable, title: str, viz_type: str, param: Dict[str, str]
+):
+ slice = create_slice(title, viz_type, table, param)
+ existing_slice = (
+ db.session.query(Slice).filter_by(slice_name=slice.slice_name).first()
+ )
+ if existing_slice:
+ db.session.delete(existing_slice)
+ db.session.add(slice)
+ db.session.commit()
+ return slice
+
+
+def _cleanup() -> None:
+ engine = get_example_database().get_sqla_engine()
+ engine.execute("DROP TABLE IF EXISTS energy_usage")
+ for slice_data in _get_energy_slices():
+ slice = (
+ db.session.query(Slice)
+ .filter_by(slice_name=slice_data["slice_title"])
+ .first()
+ )
+ db.session.delete(slice)
+
+ metric = (
+ db.session.query(SqlMetric).filter_by(metric_name="sum__value").one_or_none()
+ )
+ if metric:
+ db.session.delete(metric)
+
+ db.session.commit()
+
+
+def _get_energy_data():
+ return [
+ {
+ "source": "Agricultural Energy Use",
+ "target": "Carbon Dioxide",
+ "value": "1.4",
+ },
+ {"source": "Agriculture", "target": "Agriculture Soils", "value": "5.2"},
+ {"source": "Agriculture", "target": "Livestock and Manure", "value": "5.4"},
+ {"source": "Agriculture", "target": "Other Agriculture", "value": "1.7"},
+ {"source": "Agriculture", "target": "Rice Cultivation", "value": "1.5"},
+ {"source": "Agriculture Soils", "target": "Nitrous Oxide", "value": "5.2"},
+ {"source": "s", "target": "Carbon Dioxide", "value": "1.7"},
+ {
+ "source": "Aluminium Non-Ferrous Metals",
+ "target": "Carbon Dioxide",
+ "value": "1.0",
+ },
+ {
+ "source": "Aluminium Non-Ferrous Metals",
+ "target": "HFCs - PFCs",
+ "value": "0.2",
+ },
+ {"source": "Cement", "target": "Carbon Dioxide", "value": "5.0"},
+ {"source": "Chemicals", "target": "Carbon Dioxide", "value": "3.4"},
+ {"source": "Chemicals", "target": "HFCs - PFCs", "value": "0.5"},
+ {"source": "Chemicals", "target": "Nitrous Oxide", "value": "0.2"},
+ {"source": "Coal Mining", "target": "Carbon Dioxide", "value": "0.1"},
+ {"source": "Coal Mining", "target": "Methane", "value": "1.2"},
+ {"source": "Commercial Buildings", "target": "Carbon Dioxide", "value": "6.3"},
+ {"source": "Deforestation", "target": "Carbon Dioxide", "value": "10.9"},
+ {
+ "source": "Electricity,heat",
+ "target": "Agricultural Energy Use",
+ "value": "0.4",
+ },
+ {
+ "source": "Electricity and heat",
+ "target": "Aluminium Non-Ferrous Metals",
+ "value": "0.4",
+ },
+ {"source": "Electricity and heat", "target": "Cement", "value": "0.3"},
+ {"source": "Electricity and heat", "target": "Chemicals", "value": "1.3"},
+ {
+ "source": "Electricity and heat",
+ "target": "Commercial Buildings",
+ "value": "5.0",
+ },
+ {
+ "source": "Electricity and heat",
+ "target": "Food and Tobacco",
+ "value": "0.5",
+ },
+ {"source": "Electricity and heat", "target": "Iron and Steel", "value": "1.0"},
+ {"source": "Electricity and heat", "target": "Machinery", "value": "1.0"},
+ {
+ "source": "Electricity and heat",
+ "target": "Oil and Gas Processing",
+ "value": "0.4",
+ },
+ {"source": "Electricity and heat", "target": "Other Industry", "value": "2.7"},
+ {
+ "source": "Electricity and heat",
+ "target": "Pulp - Paper and Printing",
+ "value": "0.6",
+ },
+ {
+ "source": "Electricity and heat",
+ "target": "Residential Buildings",
+ "value": "5.2",
+ },
+ {"source": "Electricity and heat", "target": "T and D Losses", "value": "2.2"},
+ {
+ "source": "Electricity and heat",
+ "target": "Unallocated Fuel Combustion",
+ "value": "2.0",
+ },
+ {"source": "Energy", "target": "Electricity and heat", "value": "24.9"},
+ {"source": "Energy", "target": "Fugitive Emissions", "value": "4.0"},
+ {"source": "Energy", "target": "Industry", "value": "14.7"},
+ {"source": "Energy", "target": "Other Fuel Combustion", "value": "8.6"},
+ {"source": "Energy", "target": "Transportation", "value": "14.3"},
+ {"source": "Food and Tobacco", "target": "Carbon Dioxide", "value": "1.0"},
+ {"source": "Fugitive Emissions", "target": "Coal Mining", "value": "1.3"},
+ {
+ "source": "Fugitive Emissions",
+ "target": "Oil and Gas Processing",
+ "value": "3.2",
+ },
+ {"source": "Harvest \/ Management", "target": "Carbon Dioxide", "value": "1.3"},
+ {
+ "source": "Industrial Processes",
+ "target": "Aluminium Non-Ferrous Metals",
+ "value": "0.4",
+ },
+ {"source": "Industrial Processes", "target": "Cement", "value": "2.8"},
+ {"source": "Industrial Processes", "target": "Chemicals", "value": "1.4"},
+ {"source": "Industrial Processes", "target": "Other Industry", "value": "0.5"},
+ {
+ "source": "Industry",
+ "target": "Aluminium Non-Ferrous Metals",
+ "value": "0.4",
+ },
+ {"source": "Industry", "target": "Cement", "value": "1.9"},
+ {"source": "Industry", "target": "Chemicals", "value": "1.4"},
+ {"source": "Industry", "target": "Food and Tobacco", "value": "0.5"},
+ {"source": "Industry", "target": "Iron and Steel", "value": "3.0"},
+ {"source": "Industry", "target": "Oil and Gas Processing", "value": "2.8"},
+ {"source": "Industry", "target": "Other Industry", "value": "3.8"},
+ {"source": "Industry", "target": "Pulp - Paper and Printing", "value": "0.5"},
+ {"source": "Iron and Steel", "target": "Carbon Dioxide", "value": "4.0"},
+ {"source": "Land Use Change", "target": "Deforestation", "value": "10.9"},
+ {
+ "source": "Land Use Change",
+ "target": "Harvest \/ Management",
+ "value": "1.3",
+ },
+ {"source": "Landfills", "target": "Methane", "value": "1.7"},
+ {"source": "Livestock and Manure", "target": "Methane", "value": "5.1"},
+ {"source": "Livestock and Manure", "target": "Nitrous Oxide", "value": "0.3"},
+ {"source": "Machinery", "target": "Carbon Dioxide", "value": "1.0"},
+ {
+ "source": "Oil and Gas Processing",
+ "target": "Carbon Dioxide",
+ "value": "3.6",
+ },
+ {"source": "Oil and Gas Processing", "target": "Methane", "value": "2.8"},
+ {"source": "Other Agriculture", "target": "Methane", "value": "1.4"},
+ {"source": "Other Agriculture", "target": "Nitrous Oxide", "value": "0.3"},
+ {
+ "source": "Other Fuel Combustion",
+ "target": "Agricultural Energy Use",
+ "value": "1.0",
+ },
+ {
+ "source": "Other Fuel Combustion",
+ "target": "Commercial Buildings",
+ "value": "1.3",
+ },
+ {
+ "source": "Other Fuel Combustion",
+ "target": "Residential Buildings",
+ "value": "5.0",
+ },
+ {
+ "source": "Other Fuel Combustion",
+ "target": "Unallocated Fuel Combustion",
+ "value": "1.8",
+ },
+ {"source": "Other Industry", "target": "Carbon Dioxide", "value": "6.6"},
+ {"source": "Other Industry", "target": "HFCs - PFCs", "value": "0.4"},
+ {
+ "source": "Pulp - Paper and Printing",
+ "target": "Carbon Dioxide",
+ "value": "1.1",
+ },
+ {
+ "source": "Rail - Ship and Other Transport",
+ "target": "Carbon Dioxide",
+ "value": "2.5",
+ },
+ {
+ "source": "Residential Buildings",
+ "target": "Carbon Dioxide",
+ "value": "10.2",
+ },
+ {"source": "Rice Cultivation", "target": "Methane", "value": "1.5"},
+ {"source": "Road", "target": "Carbon Dioxide", "value": "10.5"},
+ {"source": "T and D Losses", "target": "Carbon Dioxide", "value": "2.2"},
+ {"source": "Transportation", "target": "Air", "value": "1.7"},
+ {
+ "source": "Transportation",
+ "target": "Rail - Ship and Other Transport",
+ "value": "2.5",
+ },
+ {"source": "Transportation", "target": "Road", "value": "10.5"},
+ {
+ "source": "Unallocated Fuel Combustion",
+ "target": "Carbon Dioxide",
+ "value": "3.0",
+ },
+ {"source": "Unallocated Fuel Combustion", "target": "Methane", "value": "0.4"},
+ {
+ "source": "Unallocated Fuel Combustion",
+ "target": "Nitrous Oxide",
+ "value": "0.4",
+ },
+ {"source": "Waste", "target": "Landfills", "value": "1.7"},
+ {"source": "Waste", "target": "Waste water - Other Waste", "value": "1.5"},
+ {"source": "Waste water - Other Waste", "target": "Methane", "value": "1.2"},
+ {
+ "source": "Waste water - Other Waste",
+ "target": "Nitrous Oxide",
+ "value": "0.3",
+ },
+ ]
Review comment:
My 2 cents would be to migrate away from the energy test fixture entirely and move to random data. I agree with Kasha's statement that relying on a data load from the network isn't a great thing for a test suite. I'd prefer for us to move to testing with more-generic and randomly generated data.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] kkucharc edited a comment on pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
kkucharc edited a comment on pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#issuecomment-738770413
Sorry for the delay in the topic (I needed switch priorities).
@villebro I[ added generating data](https://github.com/apache/incubator-superset/pull/11308/files#diff-db67f820e7e94e1a086a2d004a7425f64a3f4317f6d5801e2a8d93267666cad1R115) as you suggested in the [comment](https://github.com/apache/incubator-superset/pull/11308#discussion_r511915875).
I also fixed all tests that were new and not passing with this fixture. I will rebase the conflict after review.
cc: @dpgaspar @willbarrett @hughhhh
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#issuecomment-710466005
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=h1) Report
> Merging [#11308](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/73690397139440a509eda74740bfd5ac6ed596db?el=desc) will **decrease** coverage by `4.56%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/11308/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #11308 +/- ##
==========================================
- Coverage 65.75% 61.19% -4.57%
==========================================
Files 838 838
Lines 39714 39711 -3
Branches 3613 3613
==========================================
- Hits 26115 24300 -1815
- Misses 13498 15230 +1732
- Partials 101 181 +80
```
| Flag | Coverage Δ | |
|---|---|---|
| #cypress | `?` | |
| #javascript | `62.60% <ø> (ø)` | |
| #python | `60.35% <ø> (-0.57%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset-frontend/src/SqlLab/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9BcHAuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvQXBwLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/dashboard/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9BcHAuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/index.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvaW5kZXguanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/dashboard/index.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9pbmRleC5qc3g=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/setup/setupColors.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwQ29sb3JzLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/chart/ChartContainer.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0Q29udGFpbmVyLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/setup/setupFormatters.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwRm9ybWF0dGVycy5qcw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/reducers/index.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvaW5kZXguanM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/setup/setupPluginsExtra.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwUGx1Z2luc0V4dHJhLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| ... and [175 more](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=footer). Last update [7369039...3239d40](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] villebro commented on a change in pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#discussion_r511915875
##########
File path: tests/fixtures/energy_dashboard.py
##########
@@ -0,0 +1,357 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import random
+import textwrap
+from typing import Dict, Set
+
+import pandas as pd
+import pytest
+from pandas import DataFrame
+from sqlalchemy import column, Float, String
+
+from superset import db
+from superset.connectors.sqla.models import SqlaTable, SqlMetric
+from superset.models.dashboard import Dashboard
+from superset.models.slice import Slice
+from superset.utils.core import get_example_database
+from tests.dashboard_utils import create_slice, create_table_for_dashboard
+from tests.test_app import app
+
+misc_dash_slices: Set[str] = set()
+
+
+@pytest.fixture()
+def load_energy_table_with_slice():
+ table_name = "energy_usage"
+ df = _get_dataframe()
+ with app.app_context():
+ yield _create_energy_table(df, table_name)
+ _cleanup()
+
+
+def _get_dataframe():
+ data = _get_energy_data()
+ return pd.DataFrame.from_dict(data)
+
+
+def _create_energy_table(df: DataFrame, table_name: str):
+ database = get_example_database()
+
+ table_description = "Energy consumption"
+ schema = {"source": String(255), "target": String(255), "value": Float()}
+ table = create_table_for_dashboard(
+ df, table_name, database, schema, table_description
+ )
+ table.fetch_metadata()
+
+ if not any(col.metric_name == "sum__value" for col in table.metrics):
+ col = str(column("value").compile(db.engine))
+ table.metrics.append(
+ SqlMetric(metric_name="sum__value", expression=f"SUM({col})")
+ )
+
+ db.session.merge(table)
+ db.session.commit()
+ table.fetch_metadata()
+
+ for slice_data in _get_energy_slices():
+ _create_and_commit_energy_slice(
+ table,
+ slice_data["slice_title"],
+ slice_data["viz_type"],
+ slice_data["params"],
+ )
+
+
+def _create_and_commit_energy_slice(
+ table: SqlaTable, title: str, viz_type: str, param: Dict[str, str]
+):
+ slice = create_slice(title, viz_type, table, param)
+ existing_slice = (
+ db.session.query(Slice).filter_by(slice_name=slice.slice_name).first()
+ )
+ if existing_slice:
+ db.session.delete(existing_slice)
+ db.session.add(slice)
+ db.session.commit()
+ return slice
+
+
+def _cleanup() -> None:
+ engine = get_example_database().get_sqla_engine()
+ engine.execute("DROP TABLE IF EXISTS energy_usage")
+ for slice_data in _get_energy_slices():
+ slice = (
+ db.session.query(Slice)
+ .filter_by(slice_name=slice_data["slice_title"])
+ .first()
+ )
+ db.session.delete(slice)
+
+ metric = (
+ db.session.query(SqlMetric).filter_by(metric_name="sum__value").one_or_none()
+ )
+ if metric:
+ db.session.delete(metric)
+
+ db.session.commit()
+
+
+def _get_energy_data():
+ return [
+ {
+ "source": "Agricultural Energy Use",
+ "target": "Carbon Dioxide",
+ "value": "1.4",
+ },
+ {"source": "Agriculture", "target": "Agriculture Soils", "value": "5.2"},
+ {"source": "Agriculture", "target": "Livestock and Manure", "value": "5.4"},
+ {"source": "Agriculture", "target": "Other Agriculture", "value": "1.7"},
+ {"source": "Agriculture", "target": "Rice Cultivation", "value": "1.5"},
+ {"source": "Agriculture Soils", "target": "Nitrous Oxide", "value": "5.2"},
+ {"source": "s", "target": "Carbon Dioxide", "value": "1.7"},
+ {
+ "source": "Aluminium Non-Ferrous Metals",
+ "target": "Carbon Dioxide",
+ "value": "1.0",
+ },
+ {
+ "source": "Aluminium Non-Ferrous Metals",
+ "target": "HFCs - PFCs",
+ "value": "0.2",
+ },
+ {"source": "Cement", "target": "Carbon Dioxide", "value": "5.0"},
+ {"source": "Chemicals", "target": "Carbon Dioxide", "value": "3.4"},
+ {"source": "Chemicals", "target": "HFCs - PFCs", "value": "0.5"},
+ {"source": "Chemicals", "target": "Nitrous Oxide", "value": "0.2"},
+ {"source": "Coal Mining", "target": "Carbon Dioxide", "value": "0.1"},
+ {"source": "Coal Mining", "target": "Methane", "value": "1.2"},
+ {"source": "Commercial Buildings", "target": "Carbon Dioxide", "value": "6.3"},
+ {"source": "Deforestation", "target": "Carbon Dioxide", "value": "10.9"},
+ {
+ "source": "Electricity,heat",
+ "target": "Agricultural Energy Use",
+ "value": "0.4",
+ },
+ {
+ "source": "Electricity and heat",
+ "target": "Aluminium Non-Ferrous Metals",
+ "value": "0.4",
+ },
+ {"source": "Electricity and heat", "target": "Cement", "value": "0.3"},
+ {"source": "Electricity and heat", "target": "Chemicals", "value": "1.3"},
+ {
+ "source": "Electricity and heat",
+ "target": "Commercial Buildings",
+ "value": "5.0",
+ },
+ {
+ "source": "Electricity and heat",
+ "target": "Food and Tobacco",
+ "value": "0.5",
+ },
+ {"source": "Electricity and heat", "target": "Iron and Steel", "value": "1.0"},
+ {"source": "Electricity and heat", "target": "Machinery", "value": "1.0"},
+ {
+ "source": "Electricity and heat",
+ "target": "Oil and Gas Processing",
+ "value": "0.4",
+ },
+ {"source": "Electricity and heat", "target": "Other Industry", "value": "2.7"},
+ {
+ "source": "Electricity and heat",
+ "target": "Pulp - Paper and Printing",
+ "value": "0.6",
+ },
+ {
+ "source": "Electricity and heat",
+ "target": "Residential Buildings",
+ "value": "5.2",
+ },
+ {"source": "Electricity and heat", "target": "T and D Losses", "value": "2.2"},
+ {
+ "source": "Electricity and heat",
+ "target": "Unallocated Fuel Combustion",
+ "value": "2.0",
+ },
+ {"source": "Energy", "target": "Electricity and heat", "value": "24.9"},
+ {"source": "Energy", "target": "Fugitive Emissions", "value": "4.0"},
+ {"source": "Energy", "target": "Industry", "value": "14.7"},
+ {"source": "Energy", "target": "Other Fuel Combustion", "value": "8.6"},
+ {"source": "Energy", "target": "Transportation", "value": "14.3"},
+ {"source": "Food and Tobacco", "target": "Carbon Dioxide", "value": "1.0"},
+ {"source": "Fugitive Emissions", "target": "Coal Mining", "value": "1.3"},
+ {
+ "source": "Fugitive Emissions",
+ "target": "Oil and Gas Processing",
+ "value": "3.2",
+ },
+ {"source": "Harvest \/ Management", "target": "Carbon Dioxide", "value": "1.3"},
+ {
+ "source": "Industrial Processes",
+ "target": "Aluminium Non-Ferrous Metals",
+ "value": "0.4",
+ },
+ {"source": "Industrial Processes", "target": "Cement", "value": "2.8"},
+ {"source": "Industrial Processes", "target": "Chemicals", "value": "1.4"},
+ {"source": "Industrial Processes", "target": "Other Industry", "value": "0.5"},
+ {
+ "source": "Industry",
+ "target": "Aluminium Non-Ferrous Metals",
+ "value": "0.4",
+ },
+ {"source": "Industry", "target": "Cement", "value": "1.9"},
+ {"source": "Industry", "target": "Chemicals", "value": "1.4"},
+ {"source": "Industry", "target": "Food and Tobacco", "value": "0.5"},
+ {"source": "Industry", "target": "Iron and Steel", "value": "3.0"},
+ {"source": "Industry", "target": "Oil and Gas Processing", "value": "2.8"},
+ {"source": "Industry", "target": "Other Industry", "value": "3.8"},
+ {"source": "Industry", "target": "Pulp - Paper and Printing", "value": "0.5"},
+ {"source": "Iron and Steel", "target": "Carbon Dioxide", "value": "4.0"},
+ {"source": "Land Use Change", "target": "Deforestation", "value": "10.9"},
+ {
+ "source": "Land Use Change",
+ "target": "Harvest \/ Management",
+ "value": "1.3",
+ },
+ {"source": "Landfills", "target": "Methane", "value": "1.7"},
+ {"source": "Livestock and Manure", "target": "Methane", "value": "5.1"},
+ {"source": "Livestock and Manure", "target": "Nitrous Oxide", "value": "0.3"},
+ {"source": "Machinery", "target": "Carbon Dioxide", "value": "1.0"},
+ {
+ "source": "Oil and Gas Processing",
+ "target": "Carbon Dioxide",
+ "value": "3.6",
+ },
+ {"source": "Oil and Gas Processing", "target": "Methane", "value": "2.8"},
+ {"source": "Other Agriculture", "target": "Methane", "value": "1.4"},
+ {"source": "Other Agriculture", "target": "Nitrous Oxide", "value": "0.3"},
+ {
+ "source": "Other Fuel Combustion",
+ "target": "Agricultural Energy Use",
+ "value": "1.0",
+ },
+ {
+ "source": "Other Fuel Combustion",
+ "target": "Commercial Buildings",
+ "value": "1.3",
+ },
+ {
+ "source": "Other Fuel Combustion",
+ "target": "Residential Buildings",
+ "value": "5.0",
+ },
+ {
+ "source": "Other Fuel Combustion",
+ "target": "Unallocated Fuel Combustion",
+ "value": "1.8",
+ },
+ {"source": "Other Industry", "target": "Carbon Dioxide", "value": "6.6"},
+ {"source": "Other Industry", "target": "HFCs - PFCs", "value": "0.4"},
+ {
+ "source": "Pulp - Paper and Printing",
+ "target": "Carbon Dioxide",
+ "value": "1.1",
+ },
+ {
+ "source": "Rail - Ship and Other Transport",
+ "target": "Carbon Dioxide",
+ "value": "2.5",
+ },
+ {
+ "source": "Residential Buildings",
+ "target": "Carbon Dioxide",
+ "value": "10.2",
+ },
+ {"source": "Rice Cultivation", "target": "Methane", "value": "1.5"},
+ {"source": "Road", "target": "Carbon Dioxide", "value": "10.5"},
+ {"source": "T and D Losses", "target": "Carbon Dioxide", "value": "2.2"},
+ {"source": "Transportation", "target": "Air", "value": "1.7"},
+ {
+ "source": "Transportation",
+ "target": "Rail - Ship and Other Transport",
+ "value": "2.5",
+ },
+ {"source": "Transportation", "target": "Road", "value": "10.5"},
+ {
+ "source": "Unallocated Fuel Combustion",
+ "target": "Carbon Dioxide",
+ "value": "3.0",
+ },
+ {"source": "Unallocated Fuel Combustion", "target": "Methane", "value": "0.4"},
+ {
+ "source": "Unallocated Fuel Combustion",
+ "target": "Nitrous Oxide",
+ "value": "0.4",
+ },
+ {"source": "Waste", "target": "Landfills", "value": "1.7"},
+ {"source": "Waste", "target": "Waste water - Other Waste", "value": "1.5"},
+ {"source": "Waste water - Other Waste", "target": "Methane", "value": "1.2"},
+ {
+ "source": "Waste water - Other Waste",
+ "target": "Nitrous Oxide",
+ "value": "0.3",
+ },
+ ]
Review comment:
@kkucharc regarding having fixtures that are generated as opposed to fetched, I do agree that it makes sense. Some time ago I added some `DataFrame` fixtures (before `pytest`, hence they're not done the elegant way):
https://github.com/apache/incubator-superset/blob/ac498ddd2310f1692d6bf204042a795bd5bcf897/tests/fixtures/dataframes.py#L106-L116
This and others in this file are used to test some `DataFrame` transformation functions in `utils/pandas_postprocessing.py`, where I can aggregate/sort/filter the `DataFrame` and then assert that the result is as expected. What makes this convenient is that the dataset is very simple, yet provides enough complexity to be able to be able to ensure that the functions work as expected.
So, for this case, perhaps we should just completely move off the energy datasets, and start using some programmatically generated dataset, and then start applying that template to all other examples datasets that are used throughout the backend tests.
@dpgaspar @betodealmeida @hughhhh do you have thoughts about how to proceed here?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] willbarrett merged pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
willbarrett merged pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#issuecomment-710466005
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=h1) Report
> Merging [#11308](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/73690397139440a509eda74740bfd5ac6ed596db?el=desc) will **decrease** coverage by `2.81%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/11308/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #11308 +/- ##
==========================================
- Coverage 65.75% 62.94% -2.82%
==========================================
Files 838 445 -393
Lines 39714 15000 -24714
Branches 3613 3694 +81
==========================================
- Hits 26115 9442 -16673
+ Misses 13498 5378 -8120
- Partials 101 180 +79
```
| Flag | Coverage Δ | |
|---|---|---|
| #cypress | `?` | |
| #javascript | `62.94% <ø> (+0.33%)` | :arrow_up: |
| #python | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset-frontend/src/SqlLab/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9BcHAuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvQXBwLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/dashboard/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9BcHAuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/index.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvaW5kZXguanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/dashboard/index.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9pbmRleC5qc3g=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/setup/setupColors.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwQ29sb3JzLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/chart/ChartContainer.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0Q29udGFpbmVyLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/setup/setupFormatters.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwRm9ybWF0dGVycy5qcw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/reducers/index.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvaW5kZXguanM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/setup/setupPluginsExtra.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwUGx1Z2luc0V4dHJhLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| ... and [596 more](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=footer). Last update [7369039...e4ebb41](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] willbarrett commented on a change in pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
willbarrett commented on a change in pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#discussion_r508769289
##########
File path: tests/fixtures/energy_dashboard.py
##########
@@ -0,0 +1,357 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import random
+import textwrap
+from typing import Dict, Set
+
+import pandas as pd
+import pytest
+from pandas import DataFrame
+from sqlalchemy import column, Float, String
+
+from superset import db
+from superset.connectors.sqla.models import SqlaTable, SqlMetric
+from superset.models.dashboard import Dashboard
+from superset.models.slice import Slice
+from superset.utils.core import get_example_database
+from tests.dashboard_utils import create_slice, create_table_for_dashboard
+from tests.test_app import app
+
+misc_dash_slices: Set[str] = set()
+
+
+@pytest.fixture()
+def load_energy_table_with_slice():
+ table_name = "energy_usage"
+ df = _get_dataframe()
+ with app.app_context():
+ yield _create_energy_table(df, table_name)
Review comment:
should this be:
```python
_create_energy_table(df, table_name)
yield
_cleanup()
```
?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#issuecomment-710466005
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=h1) Report
> Merging [#11308](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=desc) (7ca7dc9) into [master](https://codecov.io/gh/apache/incubator-superset/commit/0396c705d4b3d886618c664aa339178bfb188066?el=desc) (0396c70) will **decrease** coverage by `0.16%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/11308/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #11308 +/- ##
==========================================
- Coverage 63.75% 63.58% -0.17%
==========================================
Files 928 928
Lines 45065 45065
Branches 4314 4314
==========================================
- Hits 28731 28656 -75
- Misses 16157 16232 +75
Partials 177 177
```
| Flag | Coverage Δ | |
|---|---|---|
| javascript | `63.15% <ø> (ø)` | |
| python | `63.84% <ø> (-0.27%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset/examples/energy.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvZW5lcmd5LnB5) | `27.50% <0.00%> (-72.50%)` | :arrow_down: |
| [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `73.81% <0.00%> (-8.59%)` | :arrow_down: |
| [superset/examples/world\_bank.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvd29ybGRfYmFuay5weQ==) | `97.10% <0.00%> (-2.90%)` | :arrow_down: |
| [superset/examples/birth\_names.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvYmlydGhfbmFtZXMucHk=) | `96.51% <0.00%> (-2.33%)` | :arrow_down: |
| [superset/models/core.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `88.67% <0.00%> (-0.27%)` | :arrow_down: |
| [superset/connectors/sqla/models.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29ubmVjdG9ycy9zcWxhL21vZGVscy5weQ==) | `90.64% <0.00%> (-0.14%)` | :arrow_down: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=footer). Last update [0396c70...7ca7dc9](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#issuecomment-710466005
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] kkucharc commented on a change in pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
kkucharc commented on a change in pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#discussion_r510824448
##########
File path: tests/charts/api_tests.py
##########
@@ -691,7 +694,7 @@ def test_get_charts_custom_filter(self):
self.assertEqual(item["slice_name"], expected_response[index]["slice_name"])
self.assertEqual(item["viz_type"], expected_response[index]["viz_type"])
- @pytest.mark.usefixtures("load_charts")
+ @pytest.mark.usefixtures("load_energy_table_with_slice", "load_charts")
Review comment:
Sure, sounds good! 👍 👌
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] hughhhh commented on a change in pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
hughhhh commented on a change in pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#discussion_r509426720
##########
File path: tests/core_tests.py
##########
@@ -59,6 +61,7 @@
from superset.utils import core as utils
from superset.views import core as views
from superset.views.database.views import DatabaseView
+from tests.utils import read_fixture
Review comment:
`read_fixture` isn't being used
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#issuecomment-710466005
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=h1) Report
> Merging [#11308](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/73690397139440a509eda74740bfd5ac6ed596db?el=desc) will **decrease** coverage by `4.73%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/11308/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #11308 +/- ##
==========================================
- Coverage 65.75% 61.02% -4.74%
==========================================
Files 838 838
Lines 39714 39711 -3
Branches 3613 3613
==========================================
- Hits 26115 24232 -1883
- Misses 13498 15298 +1800
- Partials 101 181 +80
```
| Flag | Coverage Δ | |
|---|---|---|
| #cypress | `?` | |
| #javascript | `62.60% <ø> (ø)` | |
| #python | `60.08% <ø> (-0.84%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset-frontend/src/SqlLab/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9BcHAuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvQXBwLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/dashboard/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9BcHAuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/index.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvaW5kZXguanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/dashboard/index.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9pbmRleC5qc3g=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/setup/setupColors.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwQ29sb3JzLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/chart/ChartContainer.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0Q29udGFpbmVyLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/setup/setupFormatters.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwRm9ybWF0dGVycy5qcw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/reducers/index.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvaW5kZXguanM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/setup/setupPluginsExtra.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwUGx1Z2luc0V4dHJhLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| ... and [180 more](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=footer). Last update [7369039...3239d40](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#issuecomment-710466005
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=h1) Report
> Merging [#11308](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/73690397139440a509eda74740bfd5ac6ed596db?el=desc) will **decrease** coverage by `5.74%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/11308/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #11308 +/- ##
==========================================
- Coverage 65.75% 60.01% -5.75%
==========================================
Files 838 394 -444
Lines 39714 24933 -14781
Branches 3613 0 -3613
==========================================
- Hits 26115 14963 -11152
+ Misses 13498 9970 -3528
+ Partials 101 0 -101
```
| Flag | Coverage Δ | |
|---|---|---|
| #cypress | `?` | |
| #javascript | `?` | |
| #python | `60.01% <ø> (-0.91%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset/db\_engines/hive.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
| [superset/examples/energy.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvZW5lcmd5LnB5) | `27.50% <0.00%> (-72.50%)` | :arrow_down: |
| [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `53.90% <0.00%> (-30.08%)` | :arrow_down: |
| [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `69.76% <0.00%> (-12.32%)` | :arrow_down: |
| [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `79.59% <0.00%> (-12.25%)` | :arrow_down: |
| [superset/db\_engine\_specs/sqlite.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3NxbGl0ZS5weQ==) | `65.62% <0.00%> (-9.38%)` | :arrow_down: |
| [superset/utils/celery.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `82.14% <0.00%> (-3.58%)` | :arrow_down: |
| [superset/examples/world\_bank.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvd29ybGRfYmFuay5weQ==) | `97.10% <0.00%> (-2.90%)` | :arrow_down: |
| [superset/examples/birth\_names.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvYmlydGhfbmFtZXMucHk=) | `97.59% <0.00%> (-2.41%)` | :arrow_down: |
| [superset/views/database/mixins.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `80.70% <0.00%> (-1.76%)` | :arrow_down: |
| ... and [450 more](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=footer). Last update [7369039...3239d40](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#issuecomment-710466005
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=h1) Report
> Merging [#11308](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/73690397139440a509eda74740bfd5ac6ed596db?el=desc) will **decrease** coverage by `4.30%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/11308/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #11308 +/- ##
==========================================
- Coverage 65.75% 61.44% -4.31%
==========================================
Files 838 838
Lines 39714 39711 -3
Branches 3613 3613
==========================================
- Hits 26115 24402 -1713
- Misses 13498 15128 +1630
- Partials 101 181 +80
```
| Flag | Coverage Δ | |
|---|---|---|
| #cypress | `?` | |
| #javascript | `62.60% <ø> (ø)` | |
| #python | `60.76% <ø> (-0.16%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset-frontend/src/SqlLab/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9BcHAuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvQXBwLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/dashboard/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9BcHAuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/index.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvaW5kZXguanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/dashboard/index.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9pbmRleC5qc3g=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/setup/setupColors.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwQ29sb3JzLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/chart/ChartContainer.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0Q29udGFpbmVyLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/setup/setupFormatters.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwRm9ybWF0dGVycy5qcw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/reducers/index.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvaW5kZXguanM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/setup/setupPluginsExtra.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwUGx1Z2luc0V4dHJhLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| ... and [172 more](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=footer). Last update [7369039...3239d40](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] kkucharc commented on a change in pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
kkucharc commented on a change in pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#discussion_r510825636
##########
File path: tests/db_engine_specs/base_engine_spec_tests.py
##########
@@ -14,19 +14,22 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-from tests.test_app import app # isort:skip
-
import datetime
from unittest import mock
+import pytest
+
from superset.db_engine_specs import engines
from superset.db_engine_specs.base import BaseEngineSpec, builtin_time_grains
from superset.db_engine_specs.sqlite import SqliteEngineSpec
from superset.utils.core import get_example_database
from tests.db_engine_specs.base_tests import TestDbEngineSpec
+from ..fixtures.energy_dashboard import load_energy_table_with_slice
from ..fixtures.pyodbcRow import Row
+from tests.test_app import app # isort:skip
+
Review comment:
You are right, that was the case, thanks!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#issuecomment-710466005
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=h1) Report
> Merging [#11308](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=desc) (7ca7dc9) into [master](https://codecov.io/gh/apache/incubator-superset/commit/0396c705d4b3d886618c664aa339178bfb188066?el=desc) (0396c70) will **decrease** coverage by `0.43%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/11308/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #11308 +/- ##
==========================================
- Coverage 63.75% 63.31% -0.44%
==========================================
Files 928 928
Lines 45065 45065
Branches 4314 4314
==========================================
- Hits 28731 28534 -197
- Misses 16157 16354 +197
Partials 177 177
```
| Flag | Coverage Δ | |
|---|---|---|
| javascript | `63.15% <ø> (ø)` | |
| python | `63.41% <ø> (-0.70%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset/db\_engines/hive.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
| [superset/examples/energy.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvZW5lcmd5LnB5) | `27.50% <0.00%> (-72.50%)` | :arrow_down: |
| [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `54.61% <0.00%> (-29.62%)` | :arrow_down: |
| [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `69.95% <0.00%> (-12.45%)` | :arrow_down: |
| [superset/examples/world\_bank.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvd29ybGRfYmFuay5weQ==) | `97.10% <0.00%> (-2.90%)` | :arrow_down: |
| [superset/examples/birth\_names.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvYmlydGhfbmFtZXMucHk=) | `96.51% <0.00%> (-2.33%)` | :arrow_down: |
| [superset/views/database/mixins.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `80.70% <0.00%> (-1.76%)` | :arrow_down: |
| [superset/models/core.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `88.14% <0.00%> (-0.81%)` | :arrow_down: |
| [superset/connectors/sqla/models.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29ubmVjdG9ycy9zcWxhL21vZGVscy5weQ==) | `90.64% <0.00%> (-0.14%)` | :arrow_down: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=footer). Last update [0396c70...7ca7dc9](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] kkucharc edited a comment on pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
kkucharc edited a comment on pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#issuecomment-738770413
Sorry for the delay in the topic (I needed switch priorities).
@villebro I added generating data as you suggested in the [comment](https://github.com/apache/incubator-superset/pull/11308#discussion_r511915875).
I also fixed all tests that were new and not passing with this fixture. I will rebase the conflict after review.
cc: @dpgaspar @willbarrett @hughhhh
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#issuecomment-710466005
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=h1) Report
> Merging [#11308](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=desc) (7ca7dc9) into [master](https://codecov.io/gh/apache/incubator-superset/commit/0396c705d4b3d886618c664aa339178bfb188066?el=desc) (0396c70) will **decrease** coverage by `0.43%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/11308/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #11308 +/- ##
==========================================
- Coverage 63.75% 63.31% -0.44%
==========================================
Files 928 462 -466
Lines 45065 28430 -16635
Branches 4314 0 -4314
==========================================
- Hits 28731 18001 -10730
+ Misses 16157 10429 -5728
+ Partials 177 0 -177
```
| Flag | Coverage Δ | |
|---|---|---|
| javascript | `?` | |
| python | `63.31% <ø> (-0.79%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset/db\_engines/hive.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
| [superset/examples/energy.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvZW5lcmd5LnB5) | `27.50% <0.00%> (-72.50%)` | :arrow_down: |
| [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `54.61% <0.00%> (-29.62%)` | :arrow_down: |
| [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `69.95% <0.00%> (-12.45%)` | :arrow_down: |
| [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `79.59% <0.00%> (-12.25%)` | :arrow_down: |
| [superset/db\_engine\_specs/sqlite.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3NxbGl0ZS5weQ==) | `65.62% <0.00%> (-9.38%)` | :arrow_down: |
| [superset/utils/celery.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `96.42% <0.00%> (-3.58%)` | :arrow_down: |
| [superset/examples/world\_bank.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvd29ybGRfYmFuay5weQ==) | `97.10% <0.00%> (-2.90%)` | :arrow_down: |
| [superset/examples/birth\_names.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvYmlydGhfbmFtZXMucHk=) | `96.51% <0.00%> (-2.33%)` | :arrow_down: |
| [superset/views/database/mixins.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `80.70% <0.00%> (-1.76%)` | :arrow_down: |
| ... and [472 more](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=footer). Last update [0396c70...7ca7dc9](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#issuecomment-710466005
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=h1) Report
> Merging [#11308](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/73690397139440a509eda74740bfd5ac6ed596db?el=desc) will **decrease** coverage by `5.74%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/11308/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #11308 +/- ##
==========================================
- Coverage 65.75% 60.01% -5.75%
==========================================
Files 838 394 -444
Lines 39714 24935 -14779
Branches 3613 0 -3613
==========================================
- Hits 26115 14964 -11151
+ Misses 13498 9971 -3527
+ Partials 101 0 -101
```
| Flag | Coverage Δ | |
|---|---|---|
| #cypress | `?` | |
| #javascript | `?` | |
| #python | `60.01% <ø> (-0.91%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset/db\_engines/hive.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
| [superset/examples/energy.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvZW5lcmd5LnB5) | `27.50% <0.00%> (-72.50%)` | :arrow_down: |
| [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `53.90% <0.00%> (-30.08%)` | :arrow_down: |
| [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `69.76% <0.00%> (-12.32%)` | :arrow_down: |
| [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `79.59% <0.00%> (-12.25%)` | :arrow_down: |
| [superset/db\_engine\_specs/sqlite.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3NxbGl0ZS5weQ==) | `65.62% <0.00%> (-9.38%)` | :arrow_down: |
| [superset/utils/celery.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `82.14% <0.00%> (-3.58%)` | :arrow_down: |
| [superset/examples/world\_bank.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvd29ybGRfYmFuay5weQ==) | `97.10% <0.00%> (-2.90%)` | :arrow_down: |
| [superset/examples/birth\_names.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvYmlydGhfbmFtZXMucHk=) | `97.59% <0.00%> (-2.41%)` | :arrow_down: |
| [superset/views/database/mixins.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `80.70% <0.00%> (-1.76%)` | :arrow_down: |
| ... and [449 more](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=footer). Last update [7369039...3239d40](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#issuecomment-710466005
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=h1) Report
> Merging [#11308](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/9856f996206840469b10bff9192785b78ac16f91?el=desc) will **decrease** coverage by `6.75%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/11308/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #11308 +/- ##
==========================================
- Coverage 62.71% 55.96% -6.76%
==========================================
Files 441 404 -37
Lines 14721 13410 -1311
Branches 3610 3392 -218
==========================================
- Hits 9233 7505 -1728
- Misses 5307 5723 +416
- Partials 181 182 +1
```
| Flag | Coverage Δ | |
|---|---|---|
| #cypress | `55.96% <ø> (?)` | |
| #javascript | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...uperset-frontend/src/dashboard/util/dnd-reorder.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2RuZC1yZW9yZGVyLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...rset-frontend/src/dashboard/util/getEmptyLayout.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEVtcHR5TGF5b3V0Lmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...rc/dashboard/util/getLayoutComponentFromChartId.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldExheW91dENvbXBvbmVudEZyb21DaGFydElkLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...dashboard/components/resizable/ResizableHandle.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL3Jlc2l6YWJsZS9SZXNpemFibGVIYW5kbGUuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...d/src/views/CRUD/csstemplates/CssTemplatesList.tsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvY3NzdGVtcGxhdGVzL0Nzc1RlbXBsYXRlc0xpc3QudHN4) | `3.57% <0.00%> (-93.73%)` | :arrow_down: |
| [.../src/dashboard/util/getFilterScopeFromNodesTree.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEZpbHRlclNjb3BlRnJvbU5vZGVzVHJlZS5qcw==) | `0.00% <0.00%> (-93.48%)` | :arrow_down: |
| [.../src/dashboard/components/FilterIndicatorGroup.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0ZpbHRlckluZGljYXRvckdyb3VwLmpzeA==) | `11.76% <0.00%> (-88.24%)` | :arrow_down: |
| [...c/explore/components/controls/withVerification.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy93aXRoVmVyaWZpY2F0aW9uLmpzeA==) | `9.09% <0.00%> (-87.88%)` | :arrow_down: |
| [...src/dashboard/components/gridComponents/Header.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0hlYWRlci5qc3g=) | `10.52% <0.00%> (-86.85%)` | :arrow_down: |
| [...rset-frontend/src/profile/components/Favorites.tsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Byb2ZpbGUvY29tcG9uZW50cy9GYXZvcml0ZXMudHN4) | `0.00% <0.00%> (-86.67%)` | :arrow_down: |
| ... and [335 more](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=footer). Last update [9856f99...0ddcae3](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#issuecomment-710466005
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=h1) Report
> Merging [#11308](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=desc) (7ca7dc9) into [master](https://codecov.io/gh/apache/incubator-superset/commit/0396c705d4b3d886618c664aa339178bfb188066?el=desc) (0396c70) will **decrease** coverage by `3.80%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/11308/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #11308 +/- ##
==========================================
- Coverage 67.49% 63.68% -3.81%
==========================================
Files 928 928
Lines 45073 45065 -8
Branches 4314 4314
==========================================
- Hits 30421 28699 -1722
- Misses 14545 16189 +1644
- Partials 107 177 +70
```
| Flag | Coverage Δ | |
|---|---|---|
| cypress | `?` | |
| javascript | `63.15% <ø> (ø)` | |
| python | `63.99% <ø> (-0.12%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset-frontend/src/SqlLab/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9BcHAuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvQXBwLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/dashboard/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9BcHAuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/index.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvaW5kZXguanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/dashboard/index.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9pbmRleC5qc3g=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/setup/setupColors.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwQ29sb3JzLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/chart/ChartContainer.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0Q29udGFpbmVyLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/reducers/index.js](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvaW5kZXguanM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...et-frontend/src/dashboard/containers/Dashboard.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb250YWluZXJzL0Rhc2hib2FyZC5qc3g=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...t-frontend/src/dashboard/containers/SliceAdder.jsx](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb250YWluZXJzL1NsaWNlQWRkZXIuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| ... and [166 more](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=footer). Last update [0396c70...7ca7dc9](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] kkucharc commented on pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
kkucharc commented on pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#issuecomment-738770413
Sorry for the delay in the topic (I needed switch priorities).
@villebro I added generating data as you suggested in the [comment](https://github.com/apache/incubator-superset/pull/11308#discussion_r511915875).
I also fixed all tests that were new and not passing with this fixture. I will rebase the conflict after review.
cc: @dpgaspar @willbarrett
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #11308: tests: added fixture with energy usage instead of example
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #11308:
URL: https://github.com/apache/incubator-superset/pull/11308#issuecomment-710466005
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=h1) Report
> Merging [#11308](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/73690397139440a509eda74740bfd5ac6ed596db?el=desc) will **decrease** coverage by `5.67%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/11308/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #11308 +/- ##
==========================================
- Coverage 65.75% 60.08% -5.68%
==========================================
Files 838 394 -444
Lines 39714 24935 -14779
Branches 3613 0 -3613
==========================================
- Hits 26115 14981 -11134
+ Misses 13498 9954 -3544
+ Partials 101 0 -101
```
| Flag | Coverage Δ | |
|---|---|---|
| #cypress | `?` | |
| #javascript | `?` | |
| #python | `60.08% <ø> (-0.84%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset/db\_engines/hive.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
| [superset/examples/energy.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvZW5lcmd5LnB5) | `27.50% <0.00%> (-72.50%)` | :arrow_down: |
| [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `53.90% <0.00%> (-30.08%)` | :arrow_down: |
| [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `69.76% <0.00%> (-12.32%)` | :arrow_down: |
| [superset/db\_engine\_specs/sqlite.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3NxbGl0ZS5weQ==) | `65.62% <0.00%> (-9.38%)` | :arrow_down: |
| [superset/utils/celery.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `82.14% <0.00%> (-3.58%)` | :arrow_down: |
| [superset/examples/world\_bank.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvd29ybGRfYmFuay5weQ==) | `97.10% <0.00%> (-2.90%)` | :arrow_down: |
| [superset/examples/birth\_names.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvYmlydGhfbmFtZXMucHk=) | `97.59% <0.00%> (-2.41%)` | :arrow_down: |
| [superset/views/database/mixins.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `80.70% <0.00%> (-1.76%)` | :arrow_down: |
| [superset/result\_set.py](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree#diff-c3VwZXJzZXQvcmVzdWx0X3NldC5weQ==) | `96.69% <0.00%> (-1.66%)` | :arrow_down: |
| ... and [447 more](https://codecov.io/gh/apache/incubator-superset/pull/11308/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=footer). Last update [7369039...3239d40](https://codecov.io/gh/apache/incubator-superset/pull/11308?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org