Skip to content

Commit

Permalink
fix: respect chart cache timeout setting (#21637)
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurnewase authored and AAfghahi committed Dec 15, 2022
1 parent c9921f8 commit 580dbaf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/integration_tests/charts/data/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import copy
from datetime import datetime
from io import BytesIO
from typing import Any, Dict, List, Optional
from typing import Any, Dict, Optional, List
from unittest import mock
from zipfile import ZipFile

Expand Down
10 changes: 7 additions & 3 deletions tests/integration_tests/fixtures/energy_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.
import random
from typing import Dict, Set
from typing import Dict, List, Set

import pandas as pd
import pytest
Expand Down Expand Up @@ -69,7 +69,7 @@ def _get_dataframe():
return pd.DataFrame.from_dict(data)


def _create_energy_table():
def _create_energy_table() -> List[Slice]:
table = create_table_metadata(
table_name=ENERGY_USAGE_TBL_NAME,
database=get_example_database(),
Expand All @@ -87,13 +87,17 @@ def _create_energy_table():
db.session.commit()
table.fetch_metadata()

slices = []
for slice_data in _get_energy_slices():
_create_and_commit_energy_slice(

slice = _create_and_commit_energy_slice(
table,
slice_data["slice_title"],
slice_data["viz_type"],
slice_data["params"],
)
slices.append(slice)
return slices


def _create_and_commit_energy_slice(
Expand Down

0 comments on commit 580dbaf

Please sign in to comment.